Here is an example of a Python program that performs basic arithmetic operations:

Created with Sketch.

Here is an example of a Python program that performs basic arithmetic operations:

# Addition
print(3 + 4)

# Subtraction
print(5 - 2)

# Multiplication
print(3 * 4)

# Division
print(10 / 2)

# Floor Division
print(10 // 3)

# Modulus
print(10 % 3)

# Exponentiation
print(3 ** 2)

The program uses the basic mathematical operators for addition (+), subtraction (-), multiplication (*), division (/), floor division (//), modulus (%), and exponentiation (**) to perform the corresponding arithmetic operations.

You can run this program by saving it in a file with a .py extension and running it using a Python interpreter.

You can also perform these operation on variables, for example:

a = 5
b = 2
print(a + b)
print(a - b)
print(a * b)
print(a / b)
print(a // b)
print(a % b)
print(a ** b)

You can also use built-in python math library functions to perform these operations.

Leave a Reply

Your email address will not be published. Required fields are marked *