0% found this document useful (0 votes)
6 views5 pages

Basic Python Arithmetic Operations

This explains a few codes about python
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views5 pages

Basic Python Arithmetic Operations

This explains a few codes about python
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Code

Addition
number1 = int(input("Enter your first number: "))
number2 = int(input("Enter your second number: "))
total = number1 + number2
print("The total of the 2 numbers is:", total)

Subtraction
number1 = int(input("Enter your first number: "))
number2 = int(input("Enter your second number: "))
difference = number1 - number2
print("The difference between the 2 numbers is", difference)

Multiplication
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
answer = num1 * num2
print("The answer is", answer)

Division
num1 = int(input("Enter the first number: "))
num2 = int(input("Enter the second number: "))
answer = num1 / num2
print("The answer is", answer)

Start
INPUT
Num1

INPUT
Num2

Total = num1 +
num2

OUTPUT
“The total of
the 2
numbers is”,
total

Stop
Start

INPUT
Num1

INPUT
Num2

difference= num1-
num2

OUTPUT
“The
difference
between the
2 numbers
is”, difference

Stop
Start

INPUT
Num1

INPUT
Num2

Total=
num1*num2

OUTPUT
“The
answer of
the 2
numbers
is”, answer

Stop
Start

INPUT
Num1

INPUT
Num2

= num1 / num2

OUTPUT
“The sum
of the 2
numbers
is”, sum

Stop

You might also like