December 2018
Beginner to intermediate
796 pages
19h 54m
English
Python integers have an unlimited range, subject only to the available virtual memory. This means that it doesn't really matter how big a number you want to store is: as long as it can fit in your computer's memory, Python will take care of it. Integer numbers can be positive, negative, and 0 (zero). They support all the basic mathematical operations, as shown in the following example:
>>> a = 14>>> b = 3>>> a + b # addition17>>> a - b # subtraction11>>> a * b # multiplication42>>> a / b # true division4.666666666666667>>> a // b # integer division4>>> a % b # modulo operation (reminder of division)2>>> a ** b # power operation2744
The preceding code should be easy to understand. Just notice one important thing: Python has two division ...
Read now
Unlock full access