Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
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 15 discussion

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

What is the expected behavior of the following code?
the_list = "alpha;beta;gamma".split(";")
the_string = ''.join(the_list)
print(the_string.isalpha())

  • A. it outputs True
  • B. it outputs False
  • C. it outputs nothing
  • D. it raises an exception
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
jarun2024
2 months, 2 weeks ago
ANS: A
upvoted 1 times
...
eskimolight
4 months ago
The Output should be TRUE - So Option A is the right. Both my IDE and ChatGPT gives the same answer.
upvoted 1 times
...
Dave304409
4 months, 3 weeks ago
D is correct
upvoted 2 times
Dave304409
4 months, 2 weeks ago
Sorry the answer correct is A
upvoted 2 times
...
...
DKAT2023
4 months, 3 weeks ago
D is the correct , the_string = ".join(the_list) should be : the_string = "".join(the_list) so it raises an exception
upvoted 2 times
dune0
1 week, 3 days ago
D is wrong, the code you wrote is not in accordance with the one listed, since you are using double quotation marks, while the example uses 2 single quotation marks. If you try the_string = ''.join(the_list) with 2 single quotation marks as given, you will notice it works without raising an exception.
upvoted 1 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 ...