Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
Location Chicago IL, USA

Exam PCAP topic 1 question 29 discussion

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

What is the expected behavior of the following code?

It will:

  • A. print 4321
  • B. print <generator object f at (some hex digits)>
  • C. cause a runtime exception
  • D. print 1234
Show Suggested Answer Hide Answer

Suggested Answer: B

Comments

vidts
2 days, 14 hours ago
answer is correct
upvoted 1 times
...
hackadocka
3 months ago
yield keyword expression is I (capital i), while for loop variable is i (small I). Function is erroneous.
upvoted 2 times
...

SaveCancel