Python Programs Class VIII
Python Programs Class VIII
Write a program in Python to take two numbers as input from the user and print the
sum.
2. Write a program in Python to take two numbers from the user and print their difference.
3. Write a program in Python to take principal, rate and time from the user and print the
Simple Interest.
4. Write a program in Python to take marks obtained from the user and print the
percentage if the maximum marks are 500.
5. Write a program in Python to take first name, middle name and last name from the user
and print their full name.
6. Write a program in Python to take distance in Km from the user and change it to miles.
(1 km = 0.621371 mile)
7. Write a program in Python to take a number from the user and print if the number is
positive, negative or zero.
8. Write a program in Python to take a number from the user and check whether the
number is odd or even.
9. Write a program in Python to take temperature in degree Celsius from the user and
convert it into Fahrenheit.
10.Write a program in Python to take height and base of triangle from the user and print its
area.
11.Write a Program in Python to take age from the user and print whether they can vote or
not. (Age to vote is 18 or more)
12.Write a program in Python to take three different numbers from the user and print the
largest number.
13.Write a program in Python to print your name 10 times using while loop
14.Write a program in Python to take number from the user and print its table using while
loop.
15. Write a program to find the greatest of four numbers entered by the user.
16.#Program to print the grade of a Student based on total percentage obtained:
english=int(input("English:"))
hindi=int(input("Hindi:"))
sanskrit=int(input("Sanskrit:"))
sst=int(input("Social Science:"))
maths=int(input("Mathematics:"))
science=int(input("Science:"))
ai=int(input("Artificial Intelligence:"))
gk=int(input("General Knowledge:"))
om=english+hindi+sanskrit+sst+maths+science+ai+gk
total=160
percentage=om*100/total
if percentage>=90:
print("Grade: A+")
elif percentage>=80 and percentage<90:
print("Grade: A")
elif percentage>=60 and percentage<80:
print("Grade: B")
elif percentage>=40 and percentage<60:
print("Grade: c")
else:
print("Fail")
17.# Python program to find the factorial of a number provided by the user.
factorial = 1