d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Syntax Error "else" Python
Add Reply New Topic New Poll
Member
Posts: 20,139
Joined: Nov 11 2008
Gold: 20.50
Jan 18 2017 12:40pm
on my jupyter-notebook, it says

if len(choosename) <= 12:
print('Okay, {}, nice to meet you'.format(choosename))
else:
print('Your name is too short')
choosename = input()

im getting

else:
^
SynataxError: invalid synatax

whats wrong with else?

This post was edited by spoofdaboss on Jan 18 2017 01:07pm
Member
Posts: 20,139
Joined: Nov 11 2008
Gold: 20.50
Jan 18 2017 01:14pm
figured it out, but no longer have time to edit the post:

"else:" wasn't lined up with "if"

thanks
Member
Posts: 13,425
Joined: Sep 29 2007
Gold: 0.00
Warn: 20%
Jan 18 2017 10:26pm
>Help me with python
>Posts code with zero indentation

Man learn to jsp.
Member
Posts: 20,139
Joined: Nov 11 2008
Gold: 20.50
Jan 19 2017 12:10am
Quote (AbDuCt @ Jan 19 2017 04:26am)
>Help me with python
>Posts code with zero indentation

Man learn to jsp.


lol..

ill keep that in mind
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll