Code not Working URGENT!


#1



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


File "python", line 6
word = original.lower()
^
IndentationError: expected an indented block


IT should store the first letter of the input as first and word should store lowercase of input


pyg = 'ay'

original = raw_input('Enter a word:')

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


#2

Indent your code inside if statement..like..

if some_condition:
    print( something)

#3

pyg = 'ay'

original = raw_input('Enter a word:')

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

LIKE THIS??


#4

OK. i removed it from if statement and it works now. Thanks!!
But then why does it say to include that part of code in the if statement?


#5

What error its throwing now?

Please format your code.


#6

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