9/11 Move it on Back


9/11 Move it on Back

It said my code wasn’t correct. I would like to know what happened.

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 ‘empty’

Please help.


what is pyg ?
where does it come from?


Sorry I forgot to add the first line.There’s a variable defined at the beginning

pyg = ‘ay’


I’m having the same issue with the exact same code. I have no idea why it’s being viewed as incorrect.


So the problem here is the the solution to the exercise contains a wrong indentation.
According to the author this is the correct answer:

Which shouldn’t be correct as lines 5 and 9 should not be indented.
It looks like the colon ‘:’ in ‘Enter a word:’ is confusing the compiler into giving a error.


@claretta, I don’t think that’s the issue, as I was able to get it to pass using standard indentation:


Hi, thanks for your feedback! The only difference I see between your screenshot and mine is the indentation of the variables line 6-7-8 (yours start below right below len(), while mine begins a bit further on the left). I think it would be of great help if the console could render where all the indentation errors occur, because it often doesn’t and the whole exercise crashes :frowning:


In python, a standard indent is 4 spaces. Therefore, the only difference is the indentation levels in the if and else statements (lines 5 and 9 respectively). Your screenshot shows those two lines having whitespace before them (improper indentation), whereas mine does not.


Indeed, and my point is that the screenshot posted above is what the exercise gives you as a solution once you hit the “Get code” button; and this contains improper indentation. This is why I think lots of users get stuck.


If this is the case, then I would recommend submitting a bug-report.


Yup, I did so. And I hope they will somehow improve the way indentation errors show up in the console. Cheers :wink:


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