Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
A program calls a function on its first line. The def statement of that function comes after the call. What happens when the program runs?
Python Programming
Easy
High School (9–10)
Python Basics › Functions
PCEP (Python Institute)
Created by
StemPy Lab
Stuck? Show a hint
A program calls a function on its first line. The
def
statement of that function comes after the call.
print(double(4)) def double(n): return n * 2
What happens when the program runs?
It prints
8
It prints
None
It stops with
SyntaxError
It stops with
NameError
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← A function builds a list from one column of a table that is a list of lists. Then the program changes both the new list and the table. What does the program print?
A function uses a local variable named sum, the same name as a built-in function. After the call, the program uses the built-in sum(). What happens when the program runs? →
More on
Python Basics › Functions
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
A function ticket_price(age) gives the price of a museum ticket: under 5 is free (0), under 13 pays…
Medium
Same name, two variables
Medium
This program should show The total is 50. It stops with an error. Find the fault and fix it.
Medium
Which of these four programs shows something? Say it before you run each one.
Easy
All problems on this topic →