Chapter 5 Flashcards
TF
A Python string literal is always enclosed in double quotes.
False
TF
The last character of a string s is at position len(s)-1
True
TF
A string always contains a single line of text.
False
TF
In Python “4” + “5” is “45”.
True
TF
Python lists are mutable, but strings are not
True
TF
ASCII is a standard for representing characters using numeric codes.
True
TF
The split method breaks a string into a list of substrings, and join does the opposite.
True
TF
A substitution cipher is a good way to keep sensitive information secure.
False
TF
The add method can be used to add an item to the end of a list.
False
TF
The process of associating a file with an object in a program is called “reading” the file.
False
Accessing a single character out of a string is called:
Index
Which of the following is the same as s[0:-1]?
s[:len(s)-1]
What function gives the Unicode value of a character?
ord
Which of the following can not be used to convert a string of digits into a number?
str
A successor to ASCII that includes characters from (nearly) all written languages is
Unicode