built in functions Flashcards

1
Q

dir(module)

A

list functions available in the module

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

abs(x)

A

Will return the absolute value (positive) of the input

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

len(x)

A

Takes a list as an argument, and returns the number of items in the list

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

list(x)

A

Takes a tuple as an input, and outputs the tuple as a list

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

max(x,….)

A

Returns the maximum value of the inputs provided

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

min(x,…..)

A

Returns the minimum value from the arguments given

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

pow(x, y)

A

Used for exponentiation. X is base, y is exponent, output is the exponentiation

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

range(x)

A

Outputs all numbers between 0 and the input, incrementing by one

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

round(x)

A

Will round up if input is above 5, and round down if input is below 4

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

sorted(x)

A

Takes in an iterable object as a parameter, returns a sorted list

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

type(x)

A

Returns an object’s type

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

isinstance(x, y)

A

Takes two parameters, object and class. Returns True is object is instance of a class.

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