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

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

What is the expected behavior of the following code?

  • A. the code is erroneous and it will not execute
  • B. it outputs 2.0
  • C. it outputs 2.5
  • D. it outputs 3.0
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
Bonesaw
10 months, 3 weeks ago
Selected Answer: B
Since people are having trouble with this, the ** means 8 raised to the power of (1/3). When you raise something to a third, it means taking the cube root. The cube root of 8 is 2, so x is less than 2.3 and the answer is B.
upvoted 3 times
...
andr3
1 year, 8 months ago
x = 2.6666666666666665 y = 2. if x < 2.3 else 3. #prints 3.0
upvoted 1 times
...
Dav023
2 years, 2 months ago
Selected Answer: B
2 is the right answer
upvoted 2 times
...
macxsz
2 years, 7 months ago
x = 2.666 y = 3.0
upvoted 2 times
macxsz
2 years, 6 months ago
sorry, incorrect. The right answer is: B. it outputs 2.0
upvoted 4 times
...
Mallie
1 year, 11 months ago
x = 2, therefore y = 2.0
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 ...