exam questions

Exam PCEP-30-02 All Questions

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

Exam PCEP-30-02 topic 6 question 297 discussion

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

The following code reads two numbers.
Which of the following is the correct input for the code?

  • A. 3, 4
  • B. 3 4
  • C. None of the above.
  • D. <pre>3 4</pre>
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
Donny_575
2 weeks, 5 days ago
Selected Answer: A
A. 3, 4 Explanation: eval() evaluates the input string as Python code, then it tries to unpack the result into two variables, x and y. So the input must be something eval() can interpret as a tuple or expression that gives two values. This is a tuple of two numbers → eval('3, 4') becomes (3, 4) Then it unpacks to x = 3, y = 4
upvoted 1 times
...
akumo
1 month ago
Selected Answer: C
C. None of the above. Most Voted
upvoted 1 times
Donny_575
2 weeks, 5 days ago
tested in PyCharm and A is correct
upvoted 1 times
...
...
Billybob0604
5 months ago
It doesn't say how you enter the numbers so the question cannot be answered
upvoted 2 times
Donny_575
2 weeks, 5 days ago
tested in PyCharm and A is correct
upvoted 1 times
...
...
CristinaDev
6 months, 3 weeks ago
Selected Answer: C
The others don't work.
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