-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexercise1.py
More file actions
36 lines (28 loc) · 1.02 KB
/
Copy pathexercise1.py
File metadata and controls
36 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Take the input of two numbers and perform arithematic operations on it and print the result.
# Read the input from the user
num1 = float(input("Enter the first number : "))
num2 = float(input("Enter the second number : "))
# addition
total = num1 + num2
print("############## Addition ##############")
print(f"Sum of {num1} + {num2} = {total}")
# Substraction
difference = num1 - num2
print("############## Substraction ##############")
print(f"Differenc of {num1} - {num2} = {difference}")
# Multiplication
product = num1 * num2
print("############## Multiplication ##############")
print(f"Product of {num1} x {num2} = {product}")
# Division
div = num1 / num2
print("############## Division ##############")
print(f"Division of {num1} / {num2} = {div}")
# Modulus
remainder = num1 % num2
print("############## Modulus ##############")
print(f"Remainder of {num1} % {num2} = {remainder}")
# Floor Division
quotient = num1 // num2
print("############## Floor Division ##############")
print(f"Quotient of {num1} // {num2} = {quotient}")