how to find the remainder in python code example
Example 1: how to calculate division with remainder in python
Modulo Operator (Python)
x % y
Example: 9 % 2
9 ÷ 2 = 4 R 1
9 % 2 = 1
Example 2: how to use a function to find the average in python
avreage_cost = cost
avg = sum(avreage)/len(avreage)
print("The average amout you spent is ", round(avg,2))
Example 3: how to use a function to find the total in spyder python
toata1= sum(total)
print("total1")