built in functions Flashcards
dir(module)
list functions available in the module
abs(x)
Will return the absolute value (positive) of the input
len(x)
Takes a list as an argument, and returns the number of items in the list
list(x)
Takes a tuple as an input, and outputs the tuple as a list
max(x,….)
Returns the maximum value of the inputs provided
min(x,…..)
Returns the minimum value from the arguments given
pow(x, y)
Used for exponentiation. X is base, y is exponent, output is the exponentiation
range(x)
Outputs all numbers between 0 and the input, incrementing by one
round(x)
Will round up if input is above 5, and round down if input is below 4
sorted(x)
Takes in an iterable object as a parameter, returns a sorted list
type(x)
Returns an object’s type
isinstance(x, y)
Takes two parameters, object and class. Returns True is object is instance of a class.