notes qs and diagrams Flashcards
1
Q
What does the format function do?
A
allows us to specify placeholder in a string, which can be replaced by some variable’s value
2
Q
how does python compare strings? what are the exceptions?
A
by alphabetical order, letters that come later in the alphabet are considered greater
exceptions:
Upper case comes before lower case
strings of digits are compared one character at a time
prefixes come before any word containing that prefix
3
Q
What is isalpha() ?
A
checks to see is all characters are in alphabet a-z
4
Q
What is mutability?
A
a type is mutable if it can be changed, immutable if not