Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam PCAP All Questions

View all questions & answers for the PCAP exam

Exam PCAP topic 1 question 60 discussion

Actual exam question from Python Institute's PCAP
Question #: 60
Topic #: 1
[All PCAP Questions]

A two-parameter lambda function raising its first parameter to the power of the second parameter should be declared as:

  • A. lambda (x, y) = x ** y
  • B. lambda (x, y): x ** y
  • C. def lambda (x, y): return x ** y
  • D. lambda x, y: x ** y
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
macxsz
2 years, 7 months ago
Selected Answer: D
D. lambda x, y: x ** y
upvoted 1 times
...
NiteshSingh
3 years, 1 month ago
D is the correct answer. d = lambda x,y:x**y print (d(2,3)) ====================== RESTART: C:\xxxxxxn.py ===================== 8 >>>
upvoted 1 times
...
Efren
3 years, 7 months ago
Correct: >>> lambda x,y:x**y <function <lambda> at 0x0000027F6788C268> >>> lambda(x,y)=x**y File "<stdin>", line 1 lambda(x,y)=x**y ^ SyntaxError: invalid syntax >>> def lambda(x,y): return x**y File "<stdin>", line 1 def lambda(x,y): return x**y ^ SyntaxError: invalid syntax
upvoted 1 times
NiteshSingh
3 years, 1 month ago
You have to use it like below - d = lambda x,y:x**y print (d(2,3))
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...