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

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

If you want to transform a string into a list of words, what invocation would you use? (Choose two.)
Expected output:

Code:

  • A. s.split ()
  • B. split (s, ' ')
  • C. s.split (' ')
  • D. split (s)
Show Suggested Answer Hide Answer
Suggested Answer: stAC 🗳️

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
CC_DC
1 year, 4 months ago
This code is so jacked up wrong. The uppercase S should be a lowercase s, the number 1 should l (letter 'l') and the F in For should be lowercase. Without these changes, the code will not even compile.
upvoted 1 times
neked
1 year, 2 months ago
This is due to copying the OCR results of screenshots in batch without looking
upvoted 2 times
...
...
Premi9
1 year, 7 months ago
Selected Answer: AC
a is correct C works only if we have space in between quotes s.split(' ') since there is space C is also correct
upvoted 1 times
...
ziadzidane
2 years, 2 months ago
A and C: don't forget a space here : s.split(' ') to avoid the error!
upvoted 4 times
...
ciccio_benzina
2 years, 2 months ago
only A is right. Error with C
upvoted 1 times
...
Suvabrata
2 years, 5 months ago
Correct answer is A. s.split(' ') will give ValueError: empty separator
upvoted 2 times
...
macxsz
2 years, 7 months ago
Selected Answer: AC
A. s.split () C. s.split (' ')
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 ...