I am new in Python and I try to sense the difference between two expression.
Is that:
a=1
if a==0 or 1:
print (a)
is same as:
a=1
if a==0 or a==1:
print(a)
I am new in Python and I try to sense the difference between two expression.
Is that:
a=1
if a==0 or 1:
print (a)
is same as:
a=1
if a==0 or a==1:
print(a)
Try using ==
instead of =
. =
is an assignment operator whereas ==
checks if the two are equal. Also, the first bit of code is not correct. You have to rewrite the entire condition.