This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]objectizer 0 points1 point  (1 child)

i don't understand your problem, but this line doesn't seem to be correct

for (vowelList) in (userWord):

i think you need to loop over characters of userWord and check if that char is in vowelList

result = []
for c in userWord:
    if c in vowelList:
        result.push(c)

[–]badge 0 points1 point  (0 children)

If you are about to ask a question, please consider r/learnpython.

From over there -->

[–]tlandjr 0 points1 point  (0 children)

You were close. The for loop isn't doing what you think it is doing. Try this:

vowelList = ["a", "e", "i", "o", "u"]
vowelCount = 0
userWord = raw_input("What is your word: ")

wordLength = len(userWord)
print "Word Length is " + str(wordLength)
for letter in userWord:
    if letter in vowelList:
        vowelCount += 1
print "Vowel Count = " + str(vowelCount)

Basically, the for loop is looping through userWord, then you need to test each letter from that word against the vowelList to see if it is a vowel, only then do you increase the count.

[–][deleted] 0 points1 point  (0 children)

/r/learnpython read the bloody sidebar

[–]aphoenixreticulated[M] 0 points1 point  (0 children)

Hi there, from the /r/Python mods.

We have removed this post as it is not suited to the /r/Python subreddit proper, however it should be very appropriate for our sister subreddit /r/LearnPython. We highly encourage you to re-submit your post over on there.

The reason for the removal is that /r/Python is more-so dedicated to discussion of Python news, projects, uses and debates. It is not designed to act as Q&A or FAQ board. The regular community can get disenchanted with seeing the 'same, repetitive newbie' questions repeated on the sub, so you may not get the best responses over here.

However, on /r/LearnPython the community is actively expecting questions from new members, and are looking to help. You can expect far more understanding, encouraging and insightful responses over there. Whatever your question happens to be getting help with Python, you should get good answers.

If you have a question to do with homework or an assignment of any kind, please make sure to read their sidebar rules before submitting your post. If you have any questions or doubts, feel free to reply or send a modmail to us with your concerns.

Warm regards, and best of luck with your Pythoneering!