python divide ints code example
Example 1: python divison //
# "normal" division in python
print(5/2) # 2
print(-5/2) # -3
print(5.0/2) # 2.5
print(-5.0/2) # -2.5
# floor division in python
print(5//2) # 2
print(-5//2) # -3
print(5.0//2) # 2.0
print(-5.0//2) # -3.0
Example 2: how to divide a variable with a digit in python
>>> x = 2
>>> y = 3
>>> z = 5
>>> x * y
6
>>> x + y
5
>>> x * y + z
11
>>> (x + y) * z
25