Mid-Book Quiz
Covers Chapters 1–5 — 5 questions.
Mid-Book Quiz
Covers Chapters 1–5 — 5 questions.
1 mark
[{"question":"What is the correct syntax for a list comprehension?","options":["[x for x in range(10)]","for x in range(10): x","list(for x in range(10))","[for x in range(10): x]"],"correct":0},{"question":"Which of the following is a mutable data type?","options":["Tuple","String","List","Integer"],"correct":2},{"question":"What does the else clause in a loop do?","options":["Runs when the loop condition is false","Runs only if no break occurred","Runs on every iteration","Runs only if an error occurs"],"correct":1},{"question":"What is a docstring used for?","options":["To delete a variable","To document a function's purpose and usage","To convert a string to a number","To define a string variable"],"correct":1},{"question":"Which operator checks if two values are equal?","options":["=","==","!=","eq"],"correct":1}]
covers-chapters-1–5