-
Notifications
You must be signed in to change notification settings - Fork 0
/
16_Math.py
32 lines (28 loc) · 849 Bytes
/
16_Math.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# =============================================================================
# Title PyHacks - Classes - Maths
# Author Gary Hutson aka hutsons-hacks.info
# Date created 13/07/2021
# =============================================================================
# In built mathematics functions
math_tuple = (12,13,56,43)
#Get the minimum value
print(min(math_tuple))
#Get the max value
print(max(math_tuple))
#Getting absolute values [x]
print(abs(-21))
#Raise a number to a power (exponent)
power = pow(math_tuple[0], 2)
print(power)
# Using the math module
import math
#Square root
square = math.sqrt(32)
print(square)
# ceiling and flooring numbers
ceiling = math.ceil(1.9)
print(ceiling)
#Get PI()
pie = math.pi
print(pie)
# All operators found here: https://www.programiz.com/python-programming/modules/math