Numbers are numeric data types used to store numeric values. Numbers can be
int is a data type that stores positive or negative numeric values with no decimals or quotation marks.
An integer is defined the same way as a variable is declared. For example:
age = 40, number_of_students = 8
A float is a data type that stores positive or negative numeric values with decimal parts.
A float is define the same way as a variable is declared. For example:
weight = 98.5, height = 1.86, average_grade = 8.95
Basic Numeric Functions
There are many numeric functions in Python but we will take a look just at a few of them.
abs(x) function takes in a numeric value
x and returns its absolute value (the positive distance between zero and the number). For example
cmp(x,y) function takes in two numeric values
y then returns
x is less than
x is equal to
x is greater than
pow(x,y) function takes in two numeric values
y then returns the value of
x to the power of
y. In other words it is
x ** y. For example
There are many more functions. You have to explore them!