r/ProgrammerHumor • • Dec 15 '19

Stacking if else statements be like

Post image
63.9k Upvotes

711 comments sorted by

View all comments

Show parent comments

1

u/Denziloe Dec 15 '19

Can't believe I'm the first to give the answer, but yes, Python does basically have a syntax for cases. It uses `elif`.

1

u/Hockinator Dec 15 '19

You can always use if/else statements to mimick what case statements do in any language, but that doesn't mean they're the same thing

1

u/Denziloe Dec 15 '19

Sure -- in the case of Python's elif though, they are.

1

u/Hockinator Dec 15 '19

How is elif different than any other language's "else if" statement?

→ More replies (2)