1/10
Modules
What is a Python Module
It is a file with a .py extension which contains some variables and constants, module functions, objects etc. defined in it, which can be used in other python programs.
How to use modules?
You can import modules using the import statement, allowing access to its functions and variables in your program.
What is Python’s standard library? With examples
A collection of many modules for different functionalities. Examples: module time offers time related functions, module string offers functions for string manipulation etc.
math.ceil, math.floor, math.sqrt
round up, round down, square root
math.exp, math.fabs, math.log(num,[base]). Explain two log cases.
e^<argument>, absolute value (magnitude), natural logarithm which takes ½ arguments. If 1 argument, gives natural log value, if two arguments, base^num.
math.log10 What happens when no argument and negative number is given? math.pow what happens when base is zero or when exp is not an int or negative?
log with base ten. range error, domain error
2 args, (base,power), domain error
math.sin, math.cos, math,tan. Condition for arguments.
sin,cos and tan values. Arguments should be a number. Arguments should be in radians. else, typeerror.
math.degrees, math.radians
radian to degrees, degrees to radian.