Sunday, September 26, 2021
Latest:
Python

# Arithmetic in Python V2 || Python Tutorial || Learn Python Programming

Today we talk about the rules of arithmetic in Python Version 2. The key detail is when combining two numbers, Python will widen numbers to make sure they are all of the same type. (In Python v2, there are four numeric types: ints, longs, floats and complex numbers.) Also, when you divide two whole numbers, Python will return the quotient, not the mathematical value.

And beware of division by 0!

To learn Python, start our Python Playlist HERE:

Subscribe…

### Similar Posts

##### 24 thoughts on “Arithmetic in Python V2 || Python Tutorial || Learn Python Programming”
1. This video published 6 years ago and question is, all this tutorial still valid to learn or this resources already got old enough to not to learn?

2. Nothing special about dividing int by int, thats what most c++ based languages follow

3. When it comes to the differences between number types in Python v2, my eyes are now wide open…

4. Hi very good 🥧🥧🧁🍫🍫🍬🍬🍬🍬🍭🍮🍶🍨🍧🍨

5. Your division example is wrong.
Python2.x rounds to the left, it does not produce the quotient.
-5/2 = -3 compared to 5/2 = 2. It is massively stupid….
Get around this by starting the code with "from _future_ import division"

6. It's official! The Socratica Python Kickstarter was a success! Thank you to all of our supporters. Because of you, many more Python videos coming soon!! 💜🦉

7. All this has gone away in Python 3

8. realli good video!
keep it uop ! Also uou remind me ov that girl rom vouager. The halv human halv borg.

9. Every year from now until 2020! Well, for the next 6 months. 🙁

10. @Soratica maybe use the term Rations instead of Reals @2:43 as I do not believe that python can represent a Real number only an approximate thereof or its Rational equivalent.
thanks for the amazing content!

11. I am watching in 2018. Now, by default division is "float", e.g. 16/5 = 3.2
this is in python 3.6.2, 2017

12. I wish they had videos like this for visual basic back in the day

13. wow this the best classes ever, thanks and I'm already stuck here, can go nowhere lol

14. Why doesn't Python have small number types like bytes. Aren't those number types easier on the processor/memory when doing a lot of small number calculations under 255? I've made a habit of doing that in Java.

15. Calculators will collapse into itself when dividing by zero!

16. I loved the videos of python
but can you make the videos of c++ i will be help full for many people all around the world
python is a high level coding language so i would like to learn c++ from your youtube channel