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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is isalpha() ?

A

checks to see is all characters are in alphabet a-z

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is mutability?

A

a type is mutable if it can be changed, immutable if not

How well did you know this?
1
Not at all
2
3
4
5
Perfectly