Python - Programming Language
This course covers the basics of programming in Python. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Math

Lesson 7
Author : Mike Dane
Last Updated : October, 2017


Code

Copyprint( 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) )