Move it back


#1

Hi, Im not sure why my code is wrong.

pyg = ‘ay’

print ‘Welcome to the Pig Latin Translator!’

original = raw_input("Enter a word: ")
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
new_word = word + first + pyg
print first
else:
print “Empty”

The error is : File “python”, line 9
new_word = word + first + pyg
^
IndentationError: unindent does not match any outer indentation level

Please help cheers


#2

Hi @csssurfer26596,

Your posted code is not formatted, therefore we cannot see its indentation.

Some common causes of IndentationErrors are:

  • Using a mixture of tabs and spaces for indentation. Use one or the other, but not both.
  • Indenting a statement where there should not be indentation, such as not inside any block.
  • Not indenting a statement where an indented statement is needed.
  • Indenting statements within a block by different amounts.

#3

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