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 10 Question 87 Discussion

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

What is the expected behavior of the following code?

x - 3 % 1

y -1 if x > else 0

print (y)

Show Suggested Answer Hide Answer
Suggested Answer: D

Contribute your Thoughts:

Christiane
22 days ago
I'm going with B. The code looks a bit wonky, and I don't think it will execute properly. Maybe the question is a trick question?
upvoted 0 times
...
Dominga
23 days ago
Haha, this question is a real head-scratcher! It's like a puzzle within a puzzle. I'm going to have to use my best problem-solving skills to crack this one.
upvoted 0 times
Cyndy
1 days ago
Yes, the correct answer is D) it outputs 0
upvoted 0 times
...
Ellen
5 days ago
I think it outputs 0 as well
upvoted 0 times
...
Stephaine
7 days ago
It outputs 0
upvoted 0 times
...
...
Julio
28 days ago
Hmm, I'm not sure about this one. The order of operations could be tricky. I'll have to think it through step-by-step.
upvoted 0 times
Raul
2 days ago
I think x - 3 % 1 would be 0.
upvoted 0 times
...
...
Rosalind
1 months ago
I think the answer is D. The code should output 0 because the modulo operator % will return the remainder of the division operation, which in this case is 0.
upvoted 0 times
Laine
16 days ago
A) it outputs -1
upvoted 0 times
...
...
Latrice
2 months ago
I'm not sure, but I think the correct answer is D) it outputs 0.
upvoted 0 times
...
Vivan
2 months ago
I agree with Mari, the code should output 0 because x - 3 % 1 equals 0.
upvoted 0 times
...
Mari
3 months ago
I think the expected behavior is to output 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