Python Functions Flashcards

1
Q

determine the class of an object

A

type()

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

return the number of characters in the string

A

len()

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

store data from the user

A

input()

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

deliver a sequence of values for the for loop

A

range()

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

generate a random number between two values

A

random.randrange()

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

absolute value

A

abs()

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

finds the highest of several expressions

A

max()

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

finds the highest of several expressions

A

max() [also works on lists]

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

find the ordinal value of a character

A

ord()

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

use the ordinal value to return the corresponding character

A

chr()

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

add the argument to the end of the list

A

s.append()

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

create a list of words from a string

A

s.split()

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

create a list from arguments

A

list()

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

create a string from a list of words

A

“glue”.join()

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