Today we talk about the rules of arithmetic in Python Version 3. The key detail is when combining two numbers, Python will widen numbers to make sure they are all of the same type. (In Python v3, there are three numeric types: ints, floats and complex numbers.) And division has changed from version 2. Now, division always returns the correct math value as a float. It no longer returns the quotient when you divide two whole numbers.
And beware of division by 0!
Python Cookbook, Third edition from O’Reilly
The Mythical Man Month – Essays on Software Engineering & Project Management
Shop Amazon Used Textbooks – Save up to 90%
Subscribe to Socratica:
To support more videos from Socratica, visit
We also accept Bitcoin! 🙂
Our address is: 1EttYyGwJmpy9bLY2UcmEqMJuBfaZ1HdG9
Python instructor: Ulka Simone Mohanty
Written & Produced by Michael Harrison
FX by Andriy Kostyuk