Write a program that accepts a string as input, then prints out the vowels in that string and then prints the consonants in that string.

This is simply a matter of combining justvowels and notvowels:

```
def splitem(name):
vowels= ""
consonants = ""
for letter in name:
if letter.lower() in "aeiou":
vowels = vowels + letter
if letter.lower() in "qwrtypsdfghjklzxcvbnm":
consonants = consonants + letter
print "Vowels: "+vowels
print "Consonsants: "+consonants
```

Note: This version explicitly checks for consonants, instead if a character is not a vowel.
A version in which that line is replaced with: if not letter.lower() in "aeiou": would also
be acceptable.

Computer Science & Information Technology

You might also like to view...

A query that tabulates totals across two or more categories is a(n) ________ query

Fill in the blank(s) with correct word

Computer Science & Information Technology

Draw a sequence diagram showing the interactions of objects in a group diary system, when a group of people are arranging a meeting.

What will be an ideal response?

Computer Science & Information Technology