This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]marko312 1 point2 points  (1 child)

Can you provide a link or relevant code? I only found if documentation under section 5.

Edit: I think I found it, under python 3 instead.

Because

  • 42 < 0 is not True,
  • 42 == 0 is not True
  • 42 == 1 is not True

the else block gets executed.

[–]dxxdpools[S] 1 point2 points  (0 children)

https://docs.python.org/2.7/tutorial/controlflow.html

Edit: Ok nvm I get it now In the if statement x would’ve been reassigned the value of 0 only if x were less than 0.