Hello, i make the course of python and on codeacdemy unit 3 part 2 (http://www.codecademy.com/courses/python-beginner-2W5v7/1/3) and i don't find the anwers This is what i do: pyg = 'ay' original = raw_input('Enter a word:') word = original.lower() first = "word"[0] if len(original) > 0 and original.isalpha(): if first == a or first == e or first == i first == o or first == u: print "vowel" else: print "consonant" else: print 'empty'
Hello @hgwca, coming here for help and checking your answers is exactly the right move. A couple things with your code, first, you have an 'or' missing in your first 'if' statement. The next issue I see is that you are assigning 'first' equal to the 0 index of "word", this will set 'first' equal to 'w', always. This will also cause the condition to print "constant" for any word not starting with a number. The first suggestions I would offer is to add the 'or' and remove the quotes from around "word" and watch how the program behaves. If you are still hitting a brick wall, come back and we will try to help. :)
Another tip: When you post code in OpenStudy, people can not copy and paste it. Try it. The code collapses. http://dpaste.com/ , http://pastebin.com/ , and https://gist.github.com/ can all easily let you share code that people can actually use. That way we can more easily debug your code. =)
hum.. Thanks a lot, I'll watch it
Join our real-time social learning platform and learn together with your friends!