exam questions

Exam PCAP-31-03 All Questions

View all questions & answers for the PCAP-31-03 exam

Exam PCAP-31-03 topic 1 question 14 discussion

Actual exam question from Python Institute's PCAP-31-03
Question #: 14
Topic #: 1
[All PCAP-31-03 Questions]

What is the expected behavior of the following code?

  • A. it outputs 3
  • B. it outputs 'None'
  • C. it outputs 0
  • D. it raises an exception
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
iemi
1 month, 3 weeks ago
Selected Answer: A
python can convert the float into a string and will go through each character (18 chars)
upvoted 1 times
...
thewoodsii81
2 months ago
Selected Answer: A
the correct answer is A as explained by prior comments
upvoted 1 times
...
jarun2024
4 months, 2 weeks ago
Step 1: When we divide 1/3 and the output will be 0.3333333333333333 Step 2: storying the values in dummy list Step 3: print(dummy[-1]) will print the last value of the list Ans : A. it outputs 3
upvoted 2 times
...
jarun2024
4 months, 2 weeks ago
Step 1: When we divide 1/3 and the output will be 0.3333333333333333 Step 2: storying the values in dummy list Step 3: print(dummy[-1]) will print the last value of the list Ans: 3
upvoted 1 times
...
Dave304409
6 months, 2 weeks ago
A is correct
upvoted 2 times
...
DKAT2023
6 months, 2 weeks ago
A is correct
upvoted 1 times
...
kstr
7 months, 1 week ago
Correct answer is A string = str(1/3) dummy = '' for character in string: dummy = dummy + character print (dummy [-1])
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