-5

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)

1 Answers1

1

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.

meyer9
  • 1,120
  • 9
  • 26