Completed

Return Values + Flow of Execution

Class 12 · Computer Science Sat, 3 Oct 2026 9:00 PM 60s / question 15 questions · 15 marks

Questions From This Challenge

Q1mcq1 mark
What does the return statement do in a function?
Prints a value to the screen
Sends a value back to the caller and ends the function's execution ✓
Deletes the function after execution
Declares a variable as global
Q2mcq1 mark
If a function does not contain a return statement, what value does calling it return by default?
0
"" (empty string)
None ✓
It causes an error
Q3mcq1 mark
In terms of flow of execution, what happens when a function is called?
The program continues in sequence and ignores the function
Control transfers to the function, its body executes, then control returns to the point right after the call ✓
The entire program restarts
The function executes independently in a separate program
Q4mcq1 mark
A function in Python can return:
Only a single value
Only integers
A single value, multiple values, or no value at all ✓
Nothing under any circumstance
Q5mcq1 mark
Consider: def calc(): return 5 print("Done") print(calc()) Which statement is true about this code?
"Done" is printed before 5
"Done" is never printed because return exits the function immediately ✓
The program raises an error
"Done" is printed after 5
Q6mcq1 mark
If function X calls function Y inside its body, what is the execution order?
Y always executes before X starts
X's statements before the call run, then Y fully executes, then X's remaining statements run ✓
X and Y execute simultaneously
Y never executes
Q7mcq1 mark
What value does a bare return statement (return with no value) send back?
0
an empty string
None ✓
False
Q8output1 mark
What is the output?
def add(a, b):
    return a + b

result = add(3, 4)
print(result)
Correct output: 7
Q9output1 mark
What is the output?
def square(n):
    return n * n

print(square(5) + 1)
Correct output: 26
Q10output1 mark
What is the output?
def test():
    print("Start")
    return 10
    print("End")

value = test()
print(value)
Correct output: Start 10
Q11output1 mark
What is the output?
def first():
    print("A")
    second()
    print("B")

def second():
    print("C")

first()
Correct output: A C B
Q12output1 mark
What is the output?
def show():
    print("Hello")
    return

x = show()
print(x)
Correct output: Hello None
Q13output1 mark
What is the output?
def minmax(a, b, c):
    return min(a, b, c), max(a, b, c)

result = minmax(4, 9, 2)
print(result)
Correct output: (2, 9)
Q14output1 mark
What is the output?
def double(n):
    return n * 2

def triple(n):
    return n * 3

print(double(triple(2)))
Correct output: 12
Q15output1 mark
What is the output?
def process(n):
    print("Processing", n)
    return n + 1

a = process(1)
b = process(a)
print(a, b)
Correct output: Processing 1 Processing 2 2 3
Next Live Challenge
Mixed: DML + Retrieval - Combined Application
Class 12 · Computer Science Fri, 23 Oct 2026, 9:00 PM
View Live Challenges →

← Back to Live Challenge History · Practice MCQs

CodeBuddy
Hi there! 👋 I'm CodeBuddy, your KV Coders assistant.

To help me give you the most accurate answers, please select your class and subject below, or just type your question!
Buddy is typing...