Word Up - Need help


#1



I tried this code number of times and it comes up with the same sentence
Oops, try again. Did you create a variable called word?
Could you please help me to complete this task


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


pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

Nothing in your if statement is indented. Your if statement needs to be formatted as such

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

#3

Thanks the code worked :smirk:


#4

rule of thumb for pretty much any code out there: If there is a colon at the end of a line of code, the next line(s) of code should be indented.


#5

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