Created
March 18, 2013 22:03
-
-
Save nharrell04/5191220 to your computer and use it in GitHub Desktop.
Why does the first one work, but the second doesn't?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pyg = 'ay' | |
original = raw_input('Enter a word:') | |
if len(original) > 0 and original.isalpha(): | |
word = original.lower() | |
first = word[0] | |
if first == "a" or "e" or "i" or "o" or "u": | |
print "vowel" | |
else: | |
print "consonant" | |
else: | |
print 'empty' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pyg = 'ay' | |
original = raw_input('Enter a word:') | |
if len(original) > 0 and original.isalpha(): | |
word = original.lower() | |
first = word[0] | |
if first == "a" or first == "e" or first == "i" or first == "o" or first == "u": | |
print "vowel" | |
else: | |
print "consonant" | |
else: | |
print 'empty' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment