+ 1

I have downloaded python 3.6. If i used else with if . syntax error comes in else. Why this happen any idea. Please.

4th Jan 2017, 2:59 PM
Dipesh Basnet
Dipesh  Basnet - avatar
8 odpowiedzi
+ 1
y=4 if y==3: print('false') else: here gives syntax error
4th Jan 2017, 3:24 PM
Dipesh Basnet
Dipesh  Basnet - avatar
+ 1
y=4 if y==3: print('false') else: here gives syntax error
4th Jan 2017, 3:26 PM
Dipesh Basnet
Dipesh  Basnet - avatar
+ 1
I have tried that also
4th Jan 2017, 3:30 PM
Dipesh Basnet
Dipesh  Basnet - avatar
+ 1
before writing anything else after else it shows invalid syntax.
5th Jan 2017, 5:30 AM
Dipesh Basnet
Dipesh  Basnet - avatar
0
provide code that gives you error
4th Jan 2017, 3:20 PM
Jakub Stasiak
Jakub Stasiak - avatar
0
you've no proper intendation.Put 4 spaces before print statement and try executing it again.
4th Jan 2017, 3:27 PM
Jakub Stasiak
Jakub Stasiak - avatar
0
Do you have anything after the else ? If not, this is the error
4th Jan 2017, 11:48 PM
Amaras A
Amaras A - avatar
0
put you code in the code playground and we'll see what happens
5th Jan 2017, 6:08 PM
Amaras A
Amaras A - avatar