The variable y has been assigned to some fixed list of four integers. Below are five calls to different lambda functions, each of which refers to the list y. Match each call to the value it returns. (lambda x: x(y)) (max) 163 (lambda x: x(1)) (lambda x: sum(y[x: :1])) 79 (lambda x: y) (3)[-1] 26 (lambda x: x[0]) (y) 17 (lambda x: x[2::-1])(y) [79,67,26]

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 8SA
icon
Related questions
Question
The variable y has been assigned to some fixed list of four integers.
Below are five calls to different lambda functions, each of which refers to the list y.
Match each call to the value it returns.
(lambda x: x(y)) (max)
163
(lambda x: x(1)) (lambda x: sum(y[x: :1]))
79
(lambda x: y) (3)[-1]
26
(lambda x: x[0]) (y)
17
(lambda x: x[2::-1])(y)
[79,67,26]
Transcribed Image Text:The variable y has been assigned to some fixed list of four integers. Below are five calls to different lambda functions, each of which refers to the list y. Match each call to the value it returns. (lambda x: x(y)) (max) 163 (lambda x: x(1)) (lambda x: sum(y[x: :1])) 79 (lambda x: y) (3)[-1] 26 (lambda x: x[0]) (y) 17 (lambda x: x[2::-1])(y) [79,67,26]
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning