Why is this not working? "Check Yourself!"


#1




Hello guys. Im stuck on this exercise and dont know why? What am I doing wrong?!?!?!
This is the error message: IndentationError: unexpected indent


print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Question")
    if len(original) > 0:
        print original
    else:
        print "empty"


#2

Go line by line and ask yourself why each indent is supposed to be there (since it's saying that you have one where it isn't expected)


#3

print 'Welcome to the Pig Latin Translator!'

# Start coding here!
original = raw_input("Question")
if len(original) > 0:
  print original
else:
  print "empty"

indent for the if and else


#4

thats what i got also


#5

Just a reminder about the indentation errors:

Unexpected indent means that you have an extra indent in the line that is told in the error post.
In this case you must remove the indent.

If the program expects an indented block, you must add an indent to the line.

If return- statement is outside a function, indent it inside the function.

The indentation problems aren't hard to fix, so try to fix them as the error post says.


#6

If your still having issues:

print 'Welcome to the Pig Latin Translator!'
original = raw_input("Type somethin Bruh")
if len(original) > 0:
print len(original)
else:
print "empty"


#8

Please don't just post code if you don't have the energy to take the time and explain, just let someone else help the user. :slight_smile:


#9

Sorry it was my first post, open to suggestions


#10

use this code
print 'Welcome to the Pig Latin Translator!'

Start coding here!

original = raw_input("ENTER A WORD")
if len(original) > 0:
print original
else:
print "Empty"


#11

both variants still does not work, with the same error


#12

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