On the Unix machines,there is a file /usr/dict/words that contains a list of English words,one per line.This file is used by spell-checking programs for example.
Write a python function which takes one argument,which is a word (as a string)and returns true if the word contains alternating vowels and consonants (i.e a consonant followed by a vowel followed by a consonant) Then write a short piece of code to read the above file and print out all the words like "banana" and "lever" but not words like "knock" and "print"
john2oth
0
Newbie Poster
Recommended Answers
Jump to PostVery smart homework problem. Now let's see some effort on your part to solve it!
Hint ...
vowels = 'aeiouy' word = 'polarity' for letter in word: if letter in vowels: print( letter )
All 3 Replies
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
john2oth
0
Newbie Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.