Program 1
list=[1,2,3,4]
A=3 in list
if A:
print('True')
Program 2
list=[1,2,3,4]
if A=3 in list:
print('True')
So I have these 2 programs. Program 1 runs fine and I understand why, but Program 2 doesn't. I thought that since A=3 in list
returns true or false you could just embed it as part of a if loop, but I guess not. Why is that? What's going on here?