Pythondex

Exercise

Simple Arithmetic Operations Exercise

In this exercise, you'll practice basic arithmetic operations in Python. You'll use integers and perform addition, subtraction, multiplication, division, and modulus.

Task

Write a Python program that:

  • Creates two variables a and b with values 10 and 3
  • Calculates and prints the following:
    • Sum: a + b
    • Difference: a - b
    • Product: a * b
    • Division: a / b
    • Remainder: a % b
  • Add comments explaining each operation

Example Output

Solve