8. Word Up


#1






It says that it is correct but I'm not sure if I really did it correctly?


Shouldn't the word I typed come out in all lowercase when tested?


pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = "original"
    word = original.lower()
    first = "original"[0]
    print original
else:
    print 'empty'


#2

If you want to print the word you typed in lowercase letters, you need to print word because right here you define word as lowercase original:

word = original.lower()

you should get rid of this line:

it's not doing anything good


#3

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
word = "original"
word = original.lower()
first = "original"[0]
print original
else:
print 'empty'

I wrote this code right? it says this.

Oops, try again. It looks like first is "o" instead of "h".


#5

I tested the code with no words and I got the result "empty" however the python system gave me an "Oops, try again." message. Is this supposed to happen?


#6

I did the same but without the 4th line of your code. But if you write original you will pass it


#7

I found the problem. Remove the colons on your 6th line dude and it will fix itself


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.