PCAP Strings • Set 12
PCAP Strings Practice Test 12 — 15 questions with explanations. Free, no signup.
A data analyst is cleaning a CSV file. They have a string variable containing a row of data: 'John,Doe,30,New York'. They need to extract the last name 'Doe' using string methods. The analyst writes: name = row.split(',')[1]. However, they are concerned about performance because the file contains millions of rows. They want to use a more efficient method that extracts the substring without creating a full list. Which approach should the analyst use?
Choose an answer to begin — your selection is scored in the full session.
15 questions · instant feedback and full explanations after every question.