Q 01/05
A) `elif`
B) `elsif`
C) `elseif`
D) `else if`
Answer · why
`elif` is short for 'else if', and a ladder of elif branches was Python's stand-in for the switch statement of other languages until `match` arrived i...
Q 02/05
A) `return`
B) `pass`
C) `break`
D) `exit`
Answer · why
`return` ends the function and passes its value to the caller; a function that falls off the end without one returns None, and `exit` is not a keyword...
Q 03/05
A) Christmas
B) Easter
C) Whitsun
D) Midsummer
Answer · why
Christmas: with his office closed for the week, van Rossum wanted a 'hobby' project to keep him occupied, and he posted the first public code just ove...
Q 04/05
A) PEP 1
B) PEP 8
C) PEP 257
D) PEP 3000
Answer · why
PEP 8 rests on van Rossum's insight that code is read much more often than it is written, so it fixes details such as a 79-character line limit and sn...
Q 05/05
A) Indentation
B) Parentheses
C) Semicolons
D) Keywords
Answer · why
Indentation marks out the blocks, and the interpreter is strict about it: Python 3 refuses to run a file whose tabs and spaces are mixed inconsistentl...
Play the full Python Programming quiz — scored, streaked, and passable to a friend.