0

Python. Can someone please explain whats the problem at the if statement?

I repeat this because no one said anything about that problem. a = int(input()) while a != 1: print (a) if a & 2 = 0: a = a // 2 else : a = a * 3 + 1 print (a)

29th Apr 2019, 8:10 PM
JohnSia2005
2 Antworten
+ 1
The modulo operator is %, not &. Also, ==, not =
29th Apr 2019, 8:13 PM
Anna
Anna - avatar
0
Anna Thx I mixt it
29th Apr 2019, 8:14 PM
JohnSia2005