Which of the following statements about the following code is false? word_counts = {} for word in text.split(): if word in word_counts: word_counts[word] += 1 else: word_counts[word] = 1
a. The expression text.split() tokenizes text by calling string method split, which separates the words using the method’s delimiter string argu-ment—if you do not provide an argument, split uses a space.
b. Method split returns a list of tokens (that is, the words in text).
c. The expression word_counts[word] += 1 inserts a new key-value pair in the dictionary.
d. All of the above statements are true.
c. The expression word_counts[word] += 1 inserts a new key-value pair in the dictionary.
You might also like to view...
The process of breaking a problem down into smaller pieces is sometimes called __________.
a. the divide and conquer method b. the scientific method c. top-down programming d. whole-into-part programming
PivotTable styles are located on the ________ tab
A) INSERT B) ANALYZE C) DESIGN D) OPTIONS
Critical Thinking QuestionsCase 1-2Visual Studio is new to you and you are trying to determine which of its languages is the best match for a couple of the projects on which you and your team are about to embark.You are looking for a program that will be the most user-friendly for two of the junior members of your team, both of whom are new to programming. Which of the following is the best match? a. Visual Basicc. Visual C#b. C++d. All of the above
What will be an ideal response?
Which task does Word NOT give you the ability to accomplish?
A. Perform calculations in a spreadsheet. B. Format text and paragraphs with fonts and colors. C. Copy and move text between documents. D. Add graphics and charts to a document.