5.1. Built in functions - JulTob/Python GitHub Wiki

abs(number)

bool(0)     
bool(Noe)   # False
bool(n_int) # true


dir(object) # Possible functions
help(object.method) # Information and use

code = 'print("Hi")'
eval(code) # evaluates line of code as if string is python code
exec(code) # Same, more code.

n = 3
str(n) 
float(n)
int(n)

Max/min

max(my_list)
min(my_list)

round

round(1.67)
# 2

round(1.67, 1)
# 1.7

type

Returns the data type

var1 = [1, 2, 3, 4]
print(type(var1))
<class 'list'>

Length

var1 = [1, 2, 3, 4]
print(len(var1))
4

int

print(int(True))
1