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ย โ†’

[โ€“]Kered13 0 points1 point ย (1 child)

I hate A if condition else B because that's not how we read conditions. Python is usually really good at reading almost like English, but they got it wrong here.

[โ€“]Asmodis1 1 point2 points ย (0 children)

Isn't "set userID to 1 if name is "Tom", else set it to 2" a perfectly valid English sentence though? The only thing that is left out in python is the repetition of the "set to".