Reading Time: 1 minutes
Python Arithmetic
The following program demonstrates the arithmetic in Python.
## ## Demonstrating arithmetic in Python a = int(input("Enter first number")) b = int(input("Enter second number")) ## + Addition print("Sum of inputs a + b:", a + b) ## - Subtraction print("Subraction of inputs a - b:", a - b) ## * Multiplication print("Multiplication of inputs a * b:", a * b) ## / Division print("Division of inputs a / b:", a / b) ## % Modulo print("Modulo a % b:", a % b) ## % Exponent print("a raised to the power b:", a ** b) ## % Floor Division: Result restricted to zero decimal points print("Floor Division a // b:", a // b) ##
Try it online here.