Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute Exam PCAP-31-03 Topic 4 Question 63 Discussion

Actual exam question for Python Institute's PCAP-31-03 exam
Question #: 63
Topic #: 4
[All PCAP-31-03 Questions]

What is the expected behavior of the following code?

x = 8 ** (1/3)

y = 2. if x < 2.3 else 3.

print(y)

Show Suggested Answer Hide Answer
Suggested Answer: A, D

Contribute your Thoughts:

Penney
13 days ago
I'm not sure, but I think the code is erroneous and will not execute
upvoted 0 times
...
Heike
14 days ago
I disagree, I believe the answer is D) it outputs 3.0
upvoted 0 times
...
Meghan
15 days ago
Wait, wait, wait... I think the answer is B) it outputs 2.5. Hear me out, okay? The expression 8 ** (1/3) evaluates to 2.0, and then the 'if x < 2.3 else 3.' part should give us 2.0 as the final result. Easy peasy!
upvoted 0 times
...
Cheryl
16 days ago
I think the answer is A) it outputs 2.0
upvoted 0 times
...
Murray
16 days ago
Hmm, let's see... I'm pretty sure the output is going to be 3.0. I mean, come on, the question says 'if x < 2.3 else 3.', and we all know that 8 ** (1/3) is greater than 2.3, so the else part should kick in. This is a no-brainer!
upvoted 0 times
...
Lovetta
20 days ago
I'm not sure, but I think the code is erroneous and will not execute
upvoted 0 times
...
Pa
22 days ago
I disagree, I believe the answer is D) it outputs 3.0
upvoted 0 times
...
Sylvie
25 days ago
I think the answer is A) it outputs 2.0
upvoted 0 times
...

Save Cancel
az-700  pass4success  az-104  200-301  200-201  cissp  350-401  350-201  350-501  350-601  350-801  350-901  az-720  az-305  pl-300  

Warning: Cannot modify header information - headers already sent by (output started at /pass.php:70) in /pass.php on line 77