#Ask for a word from the keyboard. #Construct a new string in which all vowels of the word #are replaced with asterisks. #For example, if a user types 'food', #your code should print 'f**d'. s = raw_input('Please enter a word ') new_string ='' for char in s: if char in 'aeiou': new_string = new_string + '*' else: new_string = new_string + char print new_string #The solutions below were done in class. Check #the handout posted on the course schedule for #complete solutions. #From handout #7 Q2. Observe that the problem #above has similarity in structure: a loop with #a condition within; #but has important difference about what is kept and #what is left out disvowel ='' for char in s: if char not in 'aeiou': disvowel = disvowel + char print disvowel #From handout #7 Q3 phrase = raw_input("phrase?") letter = raw_input("letter?") if letter.upper() or letter in phrase: print letter, " is in ", phrase else: print "no"