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

Exam PCEP-30-02 All Questions

View all questions & answers for the PCEP-30-02 exam

Exam PCEP-30-02 topic 1 question 60 discussion

Actual exam question from Python Institute's PCEP-30-02
Question #: 60
Topic #: 1
[All PCEP-30-02 Questions]

What is the expected output of the following code?

  • A. 0 1
  • B. 1 0
  • C. The code is erroneous.
  • D. 0 0
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Vano1
3 weeks, 1 day ago
Selected Answer: C
.vals() method doesn't exist. The correct method is .values(). Therefore, the correct answer is C.
upvoted 1 times
...
pescamillam
4 weeks, 1 day ago
Selected Answer: C
Traceback (most recent call last): File "main.py", line 2, in <module> for d in data.vals(): AttributeError: 'dict' object has no attribute 'vals'
upvoted 1 times
...
SarangM
1 month ago
Selected Answer: A
A is the correct answer
upvoted 1 times
...
Ragoo
1 month ago
Run the code it shows the out out 0 1 data = {'1': '0', '0': '1'} for d in data.values(): print(d, end=' ') The answer is A
upvoted 1 times
Vano1
3 weeks, 1 day ago
in the code is "data.vals()" which is erronous. Therefore, the correct answer is C.
upvoted 1 times
...
...
megan_mai
2 months, 4 weeks ago
Selected Answer: C
AttributeError: 'dict' object has no attribute 'vals' data.values() is the correct method
upvoted 2 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 ...