1) Which is a loop structure? a) return b) for c) def d) if-else 2) What does 'return' do in a function? a) Defines function b) Starts loop c) Ends loop d) Returns value 3) How to return two values? a) return a b b) return a + b c) return a, b d) return (a) 4) What is a parameter? a) Loop variable b) Function input c) Return value d) String method 5) Which is a conditional statement? a) if b) def c) for d) while 6) What keyword defines a function? a) def b) return c) if d) loop 7) Which is not a loop? a) for b) while c) if d) do-while 8) What is a default parameter? a) Return type b) No value c) Loop counter d) Predefined value 9) How to call a function? a) function() b) return function c) call function d) def function 10) If a function is defined to return two distinct values, such as an integer and a string, and the result is assigned to a single variable, what will that variable contain? a) Only the first value (the integer), with the second value being discarded. b) Only the second value (the string), with the first value being discarded. c) A tuple containing both values, which allows the single variable to hold a sequence of multiple items. d) A list containing both values in the order they were returned.

Control Structures and Functions in Python

Leaderboard

Visual style

Options

Switch template

Continue editing: ?