Compsci 6, Fall 2011, Classwork 8
PRINT Names and NetID of students in group (min 2, max 3)
Name: __________________________ NetID: _____________
Name: __________________________ NetID: _____________
Name: __________________________ NetID: _____________
Problems:
For the following assume is_vowel(ch) has been written and returns True
if ch is a vowel and False otherwise (Vowels are aeiou). You may
use is_vowel(ch) in writing these functions.
- Complete the function
vowelsOnly below. Given a string parameter word, vowelsOnly returns only the
vowels from word as a string. For example,
vowelsOnly('computer') returns 'oue'
def vowelsOnly(word):
"""
returns a string of only the vowels from word
"""
- Complete the function below. Use is_vowel(ch)
in writing the function.
def allvowels(word):
"""
returns True if the word is all vowels
returns False otherwise
"""
- What are the resulting lists for the following?
print [j+1 for j in range(20) if (j%3)==0]
print [i*2 for i in [j+1 for j in range(20) if (j%3)==0] if i*i>19]