4/11


#1

<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>

<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-python/lessons/pyglatin/exercises/check-yourself?action=lesson_resume

<In what way does your code behave incorrectly? Include ALL error messages.>
The code i wrote didn’t give me an error. It worked exactly as it was supposed to.

The problem was i didn’t move print “empty” under else:
I don’t understand why this is a problem. Can someone explain please?

```python

if len(original) > 0:
print original

else: print “empty”

#However the answer is

if len(original) > 0:
print original
else:
print “empty”

<do not remove the three backticks above>

#2

It has to do with the SCT, not the interpreter. The author did not write the SCT to expect a one line else clause.


#3

Okay. So it dose not really matter dose it?


#4

Not technically, no, but it may affect readability. White space is free and ample use of it and consistent style goes a long way.


#5

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