#Marksheet program in pyhton
#input student details
name=input ("Enter student name :")
cl=input ("Enter Class :")
roll=input ("Enter Roll No :")
#input marks for subjects
print("\n Enter marks out of 100 :")
eng=float(input("English :"))
mat=float(input("Maths :"))
sc=float(input("Science :"))
hin=float(input("Hindi :"))
sst=float(input("Social Studies :"))
ai=float(input("Artificial Intelligence :"))
#Total andd Percentage
total=eng+mat+sc+hin+sst+ai
per=total/5
if per>=90:
Grade = "A1"
elif per>=80:
Grade = "A2"
elif per>=70:
Grade = "B1"
elif per>=60:
Grade = "B2"
elif per>=50:
Grade = "C1"
elif per>=40:
Grade = "C2"
elif per>=33:
Grade = "D"
else:
Grade = "E (Fail)"
#Display Marksheet
print("\n--------DON BOSCO SCHOOL, SILCHAR----------")
print("\n------------TERM-I EXAMINATION-------------")
print("\n-----------------MARKSHEET-----------------")
print("NAME : ",name)
print("Class : ",cl)
print("Roll No : ",roll)
print("..............................................")
print("English : ",eng)
print("Maths : ",mat)
print("Science : ",sc)
print("Hindi : ",hin)
print("Social studies : ",sst)
print("Artificial Intelligence : ",ai)
print("..............................................")
print("Total Marks :",total)
print("Percentage :",per)
print("Grade :",Grade)
print("..............................................")
2. Write a program to check 1. To display multiplication table of a number
2. To display first ten natural numbers
3. To display area and perimeter of a rectangle
4. To display area and perimeter of a square
print("............Welcome to python program...............\n")
print("Press 1. To display multiplication of a number")
print("Press 2. To display first ten natural numbers")
print("Press 3. To display area and perimeter of a rectangle")
print("Press 4. To display area and perimeter of a square")
print("\n..................................................")
opt=int(input("Enter your option :"))
if opt==1:
print("Display multiplication of a number\n")
n=int(input("Enter a number to display multiplication table :"))
for i in range (1,11):
print(n,"x",i,"=",n*i)
elif opt==2:
print("Display first ten natural numbers\n")
for i in range (1,11):
print(i)
elif opt==3:
print("Display area and perimeter of a rectangle\n")
l=int(input("Enter the length of rectangle :"))
b=int(input("Enter the breadth of rectangle :"))
print("Area =",l*b)
print("Perimeter =",2*(l+b))
elif opt==4:
print("Display area and perimeter of a square\n")
l=int(input("Enter the side of square :"))
print("Area =",s*s)
print("Perimeter =",4*s)
else:
print("Invalid Input")
print("Enter a valid option.")
3. Write a program to check
1. To display the product of two numbers if both the numbers are less than 10
2. To display the product of two numbers if any one of the number is greater
than 10
3. To display even numbers in a range
4. To display multiplication table of a number and stop before it reaches three
digit number
print("............Welcome to python program...............\n")
print("Press 1. To display the product of two numbers if both the numbers are less than
10")
print("Press 2. To display the product of two numbers if any one of the number is greater
than 10")
print("Press 3. To display even numbers in a range")
print("Press 4. To display multiplication table of a number and stop before it reaches three
digit number.")
print("\n..................................................")
opt=int(input("Enter your option :"))
if opt==1:
x=int(input("Enter the first number: "))
y=int(input("Enter the second number: "))
if (x<10 and y<10):
print ("The product=",x*y)
else:
print ("Invalid input")
elif opt==2:
x=int(input("Enter the first number: "))
y=int(input("Enter the second number: "))
if (x<10 or y<10):
print ("The product=",x*y)
else:
print ("Invalid input")
elif opt==3:
x=int(input("Enter the first number in the range: "))
y=int(input("Enter the last number in the range : "))
print("The even numbers are : " )
for i in range(x, y):
if i%2==0:
print (i)
elif opt==4:
a=int(input("Enter the number:"))
b=1
while a*b<=100:
print (a,"x",b,"=",a*b)
b=b+1
else:
print("Invalid Input")
print("Enter a valid option.")