Skip to content

Latest commit

 

History

History
40 lines (24 loc) · 532 Bytes

File metadata and controls

40 lines (24 loc) · 532 Bytes

Commands used in the Egghead.io Series Intro to Python

Lesson Seven - Math Operations in Python

Code to sum two numbers in Python:

3 + 4

Code to subtract two numbers in Python:

3 - 4

Code to multiply two numbers in Python:

3 * 4

Code for integer division in Python 2:

3 / 4

Code for float division in Python 2:

3 / 4.

Code for integer division in Python 3:

3 // 4

Code for float division in Python 3:

3 / 4

Code to perform math operations using variables:

a = 3
b = 4
a + b
a / b
a // b