0% found this document useful (0 votes)
5 views2 pages

Python Programs

The document contains a series of Python programs that demonstrate basic arithmetic operations such as sum, product, difference, quotient, and remainder of numbers. It also includes calculations for kinetic and potential energy, as well as finding the sum and average of three student marks. Each program uses the input statement to gather user input and prints the result.

Uploaded by

binduannthomas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Python Programs

The document contains a series of Python programs that demonstrate basic arithmetic operations such as sum, product, difference, quotient, and remainder of numbers. It also includes calculations for kinetic and potential energy, as well as finding the sum and average of three student marks. Each program uses the input statement to gather user input and prints the result.

Uploaded by

binduannthomas
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

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)

You might also like