The variable s holds the string "mississippi". Fill in the value each expression evaluates to, exactly as Python would display it, using True or False for yes-or-no results and no quotation marks.
Unlock full course notes by signing up
Method calls that are never stored
A student wants to tidy a name and then inspect it, and writes this program:
The string assigned to name has exactly two spaces at each end. What does the program print?
Tracing backward slices with different stops
A display program reads characters backward from a stored label. Using the Python code below, fill each blank with the resulting string. Enter letters only, without quotation marks.
The value of first is ________. The value of second is ________.
Parsing a line read from a file
An order log is read from a text file one line at a time, so each line still ends with a newline character. One line is processed like this:
The string assigned to record starts with two spaces. Find the length of clean as an integer, the number of elements in fields as an integer, the value of clean.find("price") as an integer, and the string stored in item, typed without quotation marks.
Reindexing a rebuilt warehouse label
A warehouse program replaces the three-digit section of a label with a two-digit section, then creates two display strings. Trace the following Python code.
Enter the exact values of display and audit, without quotation marks and with matching capitalization. Also enter size as an exact integer number of characters.