0

python program showing irrelevently invalid syntax

i=int(input("enter any no.")) m=0 l=[] while i>0: m=i%2 if m = 1: m=0 l.append(m) if m=0: m=1 l.append(m) i=i//2 print(l) in this code it's showing that if statement's syntax is invalid. plz tell why ?

19th Jul 2021, 3:09 PM
Aman Maurya
Aman Maurya - avatar
2 Antworten
+ 1
thank you 😊
19th Jul 2021, 3:12 PM
Aman Maurya
Aman Maurya - avatar
0
Indentation and the difference between "=" and "==" are sneaky killers.
19th Jul 2021, 3:43 PM
BootInk
BootInk - avatar