Python Functions Flashcards
1
Q
determine the class of an object
A
type()
2
Q
return the number of characters in the string
A
len()
3
Q
store data from the user
A
input()
4
Q
deliver a sequence of values for the for loop
A
range()
5
Q
generate a random number between two values
A
random.randrange()
6
Q
absolute value
A
abs()
7
Q
finds the highest of several expressions
A
max()
8
Q
finds the highest of several expressions
A
max() [also works on lists]
9
Q
find the ordinal value of a character
A
ord()
10
Q
use the ordinal value to return the corresponding character
A
chr()
11
Q
add the argument to the end of the list
A
s.append()
12
Q
create a list of words from a string
A
s.split()
13
Q
create a list from arguments
A
list()
14
Q
create a string from a list of words
A
“glue”.join()