8. Word Up


#1

https://www.codecademy.com/courses/python-beginner-2W5v7/1/2?curriculum_id=4f89dab3d788890003000096

"Oops, try again. Did you create a variable called word?"

"File "python", line 6
word = original.lower():
^
SyntaxError: invalid syntax"

I don't know what to do or what I did wrong

pyg = 'ay'

original = raw_input('Enter a word:')

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

#2

remove your colon as it is not needed :slight_smile:

also you do not need to indent print original here


#3

Thanks for your help and such a fast reply! :grinning:


#4

pyg = 'ay'

original = raw_input('Enter a word:')

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


#5

Why are you posting a solution to an already solved problem from 8 days ago?

Also, what good does it do for the community to just post the answer without discussing why you did what you did?


#6

it's worked

pyg = 'ay'

original = raw_input('Enter a word:')

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


#7

What's wrong with my code ? it says did you create a variable called word.
pyg = 'ay'

original = raw_input('Enter a word:')

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

else:
print 'empty'


#8

But why we are doing these things inside the if statement?
If i do this before if statement,will that make any difference? And why?


#9

hi guys,
I'm stuck on word up, I've tried every possible code , but still not working...........

pyg = 'ay'

original = raw_input('Enter a word:')

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


#11