Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 109912f

Browse files
arthmopp.py
1 parent 1cc80e2 commit 109912f

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

‎Basic/arthmopp.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Store input numbers:
2+
num1 = input('Enter first number: ')
3+
num2 = input('Enter second number: ')
4+
5+
# Add two numbers
6+
sum = float(num1) + float(num2)
7+
# Subtract two numbers
8+
min = float(num1) - float(num2)
9+
# Multiply two numbers
10+
mul = float(num1) * float(num2)
11+
#Divide two numbers
12+
div = float(num1) / float(num2)
13+
# Display the sum
14+
print('The sum of {0} and {1} is {2}'.format(num1, num2, sum))
15+
16+
# Display the subtraction
17+
print('The subtraction of {0} and {1} is {2}'.format(num1, num2, min))
18+
# Display the multiplication
19+
print('The multiplication of {0} and {1} is {2}'.format(num1, num2, mul))
20+
# Display the division
21+
print('The division of {0} and {1} is {2}'.format(num1, num2, div))

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /