Back to: Python Basics
0
Aim :- Write A Python Program To Create A Simple CalculatorÂ
def SimpleCalculator():
# Inputs For Getting Numbers From The User
no1 = int(input("Enter First Number : "))
no2 = int(input("Enter Second Number :"))
# Arithmetic Operations
add = no1 + no2
sub = no2 - no1
mul = no1 * no2
div = no2 / no1
expo = no2 ** no1
neg = ~(no1)
rem = no2 % no1
print("\nFirst Number =",no1)
print("Second Number =",no2)
print("\n~~~~~~~Arithmetic Operations~~~~~~~")
print("Addition =",add)
print("Subtraction =",sub)
print("Multiplication =",mul)
print("Division = ",div)
print("Exponentation =",expo)
print("Negation =",neg)
print("Remainder =",rem)
SimpleCalculator()
Algorithm :-
Step 1 :- Take the Input from the user.
Step 2 :- Compute the values using the two inputed numbers.
Step 3 :- Display the computed value.
P.N. : All the post on this website are for demonstration and education purpose only.
Student should perform all the practicals for there personal copies.