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 110 discussion

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

What is the expected output of the following code?

  • A. 3
  • B. 5
  • C. 4
  • D. an exception is raised
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

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
AxiansPT
1 year, 4 months ago
y(x) ????
upvoted 1 times
...
swatiphadtare
1 year, 6 months ago
I get exception for return y(X) statement
upvoted 1 times
...
swatiphadtare
1 year, 7 months ago
What kind of statement is y(x)? how does that work? can someone please explain?
upvoted 1 times
Simdjen
1 year, 2 months ago
y becomes 'lambda x: x*x' as stated in the print function. With x == 1 we will get lambda x: 1*1(1) + (1+1) = 3
upvoted 1 times
...
...
macxsz
2 years, 6 months ago
Selected Answer: A
answer: A. 3
upvoted 2 times
...
TheNetworkStudent
2 years, 8 months ago
in the invocation of foo() in the example there's clearly an L and not a 1... Assuming it's supposed to be a 1: A is correct, if it's an L: D is correct.
upvoted 4 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 ...