With the three basic number types described in the previous post, it is possible to use the Python shell as a simple calculator using the following operators:+ Addition- Subtraction* Multiplication/ Floating-point division// Integer division% Modulus (remainder)** ExponentiationThese are binary operators in that they act on two numbers (the operands) to produce a third (e.g. 2**3 evaluates to 8).Python...
Wednesday, February 24, 2021
Thursday, February 18, 2021
The Core Python Language (Numbers)
Among the most basic Python objects are the numbers, which come in three types: integers (type: int), floating-point numbers (type: float) and complex numbers (type: complex).IntegersIntegers are whole numbers such as 1, 8, 72 and 3847298893721407. In Python 3, there is no limit to their magnitude (apart from the availability of your computer’s memory). Integer arithmetic is exact. For clarity,...
Tuesday, February 16, 2021
Jupyter Notebook
There are various ways to run Python statements. We can run Python statements in a script and in the interpreter’s interactive mode. The main advantage of using interactive mode is the immediate feedback. The main disadvantage of this mode is that, if we make any mistakes in typing the statements and...