-1

So in new to python and i'm studying A-level computing and our language to lean is python. I'm really far behind and i don't know anything. Despite already being 2 terms in already and only 4/5 months left till examination period. So I've been watching a video tutorial and for some reason i cant use "else" ![Here is what the tutorial has done, I've copied everything out][1]

Here is what the tutorial has done:

sister_age = 15

brother_age = 12

if sister_age > brother_age:


 print" "sister is older"

else:

   print "brother is older"

This the out comes of this is "sister is older

However i have copied it out:

sister_age=15

 brother_age=12

 if sister_age>brother_age:

print("sister is older")

   else:

Then an error message occurs saying the following:

"SyntaxError: unindent does not match any outer indentation level"

Im sorry but i just don't understand. Thanks alot, for your time to read this.

tobias_k
  • 81,265
  • 12
  • 120
  • 179
watteven
  • 15
  • 1

1 Answers1

1

Indentation is the key.

sister_age = 15
brother_age = 12
if sister_age > brother_age:
    print "sister is older"
else:
    print "brother is older"
Jonathan Davies
  • 882
  • 3
  • 12
  • 27