Write a Python program to enter two numbers and find their sum.
Write a Python program to enter two numbers and perform all arithmetic operations.
Solution :-Â
StaticÂ
a = 10
b = 20
add = a+b
sub = a-b
mul = a*b
div = a/b
div1 = a//b
mod = a%b
print("The sum of 2 number is :- ",add)
print("The sub of 2 number is :- ",sub)
print("The mul of 2 number is :- ",mul)
print("The div of 2 number is :- ",div)
print("The div1 of 2 number is :- ",div1)
print("The mod of 2 number is :- ",mod)
Solution
DYNAMIC
a = int(input("Enter the First number :- "))
b = int(input("Enter the Second number :- "))
c = a+b
print("The sum of 2 number is :- ",c)
Solution