by Josh on 01/01/2024
Arithmetic operators in Python are used to perform mathematical operations such as addition, subtraction, multiplication, division, and more. Here are some common arithmetic operators and examples of how to use them:
result = 10 + 5 # result is 15
result = 10 - 5 # result is 5
result = 10 * 5 # result is 50
result = 10 / 5 # result is 2.0
result = 10 // 3 # result is 3
result = 10 % 3 # result is 1
result = 2 ** 3 # result is 8