Code error , please help


#1



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


File "python", line 8
print "original"
^
IndentationError: expected an indented block


print 'Welcome to the Pig Latin Translator!'


original = raw_input("Enter a word:")
original = ""

if len(original)>0 :
print "original"
else : 
print "Empty"


#2

after a if you should indent:

if condition:
   print "indention required"

#3

Thanks, hate python because of indentations :smiley:


#4

then i would pick another language, python is one of very few languages which relies on indention to keep track of what is part of a function, if and many more.


#6

But the indentations are a good thing to learn. :wink:


#7

for organizing your code yes, but in other languages the indention is less strict given it isn't needed for to determination what is part of function/if clause


#8

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