python program showing irrelevently invalid syntax | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponses
+ 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