0% found this document useful (0 votes)
2 views

Practice Question

The document contains a series of Python programming practice questions and their solutions. Each question focuses on basic programming concepts such as addition, simple interest calculation, area of geometric shapes, percentage calculation, and unit conversion. The solutions provided demonstrate the use of input functions, arithmetic operations, and print statements.

Uploaded by

kiran04051985
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)
2 views

Practice Question

The document contains a series of Python programming practice questions and their solutions. Each question focuses on basic programming concepts such as addition, simple interest calculation, area of geometric shapes, percentage calculation, and unit conversion. The solutions provided demonstrate the use of input functions, arithmetic operations, and print statements.

Uploaded by

kiran04051985
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
You are on page 1/ 2

Practice Questions

Q1: Write a python program used to take two numbers from the user and find its
addition.
Sol:
num1 = int(input(“Enter first no.”))
num2 = int(input(“Enter second no.”))
sum = num1 + num2
print("Sum of two numbers=, sum)

Q2: Write a python program used to calculate Simple Interest by using the given
formula: SI=(P*R*T)/100
Sol:
P = int(input(“Enter first no.”))
R = int(input(“Enter second no.”))
T = int(input(“Enter second no.”))
SI = (P*R*T)/100
print("Sum of two numbers=, sum)

Q3: Writea program that accepts base and height and


calculate the area of a triangle.
Sol:
b=float(input(“Enter the base of triangle:”))
h=float(input(“Enter the height of triangle:”))
Area=(1/2)*b*h
print(“The area of triangle is:”, Area)

Q4. Write a program that inputs a student’s marks in three


subjects (out of 100) and prints the percentage marks.
print(“Enter the marks of three subject out of 100”)
a=float(input(“Enter the marks of first subject:”))
b=float(input(“Enter the marks of second subject:”))
c=float(input(“Enter the marks of third subject:’))
P=(a+b+c)/3
print(“The percentage marks are:”, P)

Q5. Write a program that reads the number n and prints


the value of n², n³ and n⁴.
Sol:
a=float(input(“Enter the value of n:”))
b=a**2
c=a**3
d=a**4
print(“The value of n² is:”, b)
print(“The value of n³ is:”, c)
print(“The value of n⁴ is:”, d)

Q6. Write a program to read base, width and height of


parallelogram and calculate its area and perimeter.
Sol:
b=float(input(“Enter the base of parallelogram:”))
w=float(input(“Enter the width of parallelogram:”))
h=float(input(“Enter the height of parallelogram:”))
Area=b*h
Perimeter=2*(b+w)
print(“The area of parallelogram is:”, Area)
print(“The perimeter of parallelogram is:”,
Perimeter)

Q7. Write a program to accept the height in cm and


convert it into feet and inches.
Sol:
a=float(input(“Enter your height in centimeters:”))
Feet=a*0.032
Inch=a*0.393
print(“Your height in feet is:”, Feet)
print(“Your height in inch is:”, Inch)

You might also like