Math
Lesson 7Author : GOUP
Last Updated : September, 2020
Video Code
print( 2 * 3 ) # Basic Arithmetic: +, -, /, *
print( 2**3 ) # Basic Arithmetic: +, -, /, *
print( 10 % 3 ) # Modulus Op. : returns remainder of 10/3
print( 1 + 2 * 3 ) # order of operations
print(10 / 3.0) # int's and doubles
num = 10
num += 100 # +=, -=, /=, *=
print(num)
++num
print(num)
# Math module has useful math methods
import math
print( pow(2, 3) )
print( math.sqrt(144) )
print( round(2.7) )