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

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

Insert the correct snippet to convert the t tuple to a dictionary named d.
Expected output:

Code:

  • A. t >> d.dict
  • B. d = dict(t)
  • C. d.dict(t)
  • D. d = t(dict)
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
hovnival
1 month, 1 week ago
Selected Answer: B
The correct snippet to convert the tuple `t` to a dictionary named `d` is: B. `d = dict(t)` So the full code will be: t = (('A', 1), ('B', 2), ('C', 3)) d = dict(t) print(d) The expected output will be: {'A': 1, 'B': 2, 'C': 3}
upvoted 1 times
...
christostz03
5 months, 2 weeks ago
b is the correct answer
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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago