PYTHON PROGRAMS-(using input statement)
1 Write a program in python to find sum of two numbers
# program to find sum of two numbers
A=int(input(“enter first number”))
B=int(input(“enter second number”))
S=A+B
print(“sum=”,S)
2 Write a program in python to find product of three numbers
# program to find product of three numbers
A=int(input(“enter first number”))
B=int(input(“enter second number”))
C=int(input(“enter third number”))
P=A*B*C
print(“product=”,P)
3 Write a program in python to find difference of two numbers
# program to find difference of two numbers
A=int(input(“enter first number”))
B=int(input(“enter second number”))
D=A-B
print(“Difference=”,D)
4. Write a program in python to find Quotient of two numbers
# program to find quotient of two numbers
A=int(input(“enter first number”))
B=int(input(“enter second number”))
Q=A/B
print(“Quotient=”,Q)
5 Write a program in python to find Remainder of two numbers
# program to find remainder of two numbers
A=int(input(“enter first number”))
B=int(input(“enter second number”))
R=A%B
print(“remainder=”,R)
6. Write a program in python to find the kinetic energy
ke=1/2mv2
# program to find kinetic energy
m=int(input(“enter mass”))
v=int(input(“enter velocity”))
ke=1/2*m*v*v [OR ] ke=1/2*m*v**2
print(“Kinetic Energy=”,ke)
7. Write a program in python to find the potential energy
pe=mgh(value of g=9.8)
# program to find potential energy
m=int(input(“enter mass”))
h=int(input(“enter height”))
g=9.8
pe=m*g*h
print(“potential Energy=”,pe)
8. Write a program in python to find sum and average of three marks of a
student
# program to find sum and average of 3 marks
A=int(input(“enter first mark”))
B=int(input(“enter second mark”))
C=int(input(“enter third mark”))
S=A+B+C
avg=S/3
print(“sum=”,S)
print(“average=”,avg)