Python Maths
Python Maths
PYTHON MATH
To:
SIR Dr.Aamir Shahzad sahib
PYTHON MATHS
1-Built –in Math Functions:
The min() and max() functions can be used to find the lowest or highest value in an iterable.
Examples:
Input Output
1:- x= min(12,09,54)
print(x) 09
2:- y= max(12,09,54)
Print(y) 54
2-Absolute Value:
Distance from zero or origin to that number, absolute value always positive value. The abs() return positive
value. Example:
Input Output
x=abs(-9) 9
print(x)
3-Power:
The number of times a number is used as factor in multiplication problem.
The pow(x,y) function returns the value of x to the power of y (x^y). Example:
Input Output
print(x)
print(x)
print(x)
y = math.floor(5.4) 5
print(y)
Data Types
Numerical Categorical Ordinal
Data are numbers,and can be split into two Data are value that cannot be measured up Data like categorical data ,but can be
categories. against each other . Example: measured up against each other.Example:
(i) Discrete Data: counted data Colour value,or any yes/no value School grade where A is better then B.
that are limited to integers.
(ii) Continuous Data: measure
data that can be any number.