Python indentation error in if statement -
i have following trouble in python.
sister_age = 15 brother_age = 12 if sisiter_age > brother_age: print "sisiter older" else:
error:
syntaxerror: invalid syntax if sisiter_age > brother_age: print "sisiter older" else: file "<pyshell#5>", line 4 else: ^ indentationerror: unindent not match outer indentation level
no matter how many times try change index, shows error.
assuming there after else
statement, else
statement should aligned if
statement, not inside it.
example -
if sisiter_age > brother_age: print "sisiter older" else:
also, if not have (or need) inside else
statement, should remove it.
Comments
Post a Comment