Index

Let’s check the specification of the numerical value and the type of the variable.

>>> x = 1
>>> type (x)
<class ‘int’>

>>> y = 1.0
>>> type (y)
<class ‘float’>

>>> z = 2
>>> sum = x + y
>>> type (sum)
<class ‘float’>

>> dif = x – z
>>> type (dif)
<class ‘int’>

>> xx = 10
>>> yy = 5
>>> zz = xx * yy
>>> type (zz)
<class ‘int’>

>> dev = xx / yy
>>> print (dev)
2.0
>>> type (dev)
<class ‘float’>

Integer division produces a floating result.