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 lambda takes a default value from a variable that changes later. What does the program print?
Python Programming
Medium
High School (11–12)
Python Basics › Functions
Class 12 Board
PCAP (Python Institute)
+3 more exams
AP
A-Level
IB
AP
A-Level
IB
PCAP (Python Institute)
Created by
StemPy Lab
Stuck? Show a hint
A lambda takes a default value from a variable that changes later.
rate = 2 scale = lambda x, r=rate: x * r rate = 10 print(scale(3), scale(3, rate))
What does the program print?
30 30
6 6
6 30
It stops with
TypeError
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← Three classes form a chain. Each one sets its own rate, and Premium extends the cost method with super(). What does the program print?
Three scopes use the name level: the module, a function task, and a function step written inside task. What does the program print? →
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 →