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

LAB Programs IP Class XI

This document contains summaries of 7 programming problems: 1) A program to input student marks in 5 subjects, calculate percentage and grade. 2) A program to calculate the factorial of a given number. 3) A program to find the sum of digits of a given number. 4) A program to display the reverse of a given number. 5) A program to read numbers into a list and count occurrences of an input element. 6) A program to find the largest and smallest numbers in a list. 7) A program to find the third largest number in a list.

Uploaded by

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

LAB Programs IP Class XI

This document contains summaries of 7 programming problems: 1) A program to input student marks in 5 subjects, calculate percentage and grade. 2) A program to calculate the factorial of a given number. 3) A program to find the sum of digits of a given number. 4) A program to display the reverse of a given number. 5) A program to read numbers into a list and count occurrences of an input element. 6) A program to find the largest and smallest numbers in a list. 7) A program to find the third largest number in a list.

Uploaded by

Adithyan R Nair
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Program to input the name and marks in 5 subjects of a student


find the percentage and grade for given marks based on the
following criteria. (Assume each subject out of 100)
Percentage >=90% A+
Between 80 and 90 A
Between 70 and 80 B
Between 60 and 70 C
Between 50 and 60 D
Else E
2. Program to find the Factorial of a given number.
n=int(input("enter n"))
i=1
fact=1
while(i<=n):
fact=fact*i
i=i+1
print(fact)
3. Program to find the sum of digits of a number
n= int (input("enter anumber"))
sum=0
while(n>0):
a=n%10
sum=sum+a
n=n//10
print(sum)
4. Program to display the reverse of a number

n= int (input("enter a number"))


rev=0
while(n>0):
a=n%10
rev = rev *10+a
n=n//10
print(rev)

5. Program to read N numbers and add it into a list.


Python code to check how many times given element exist in
the list.

List1= []
N=int(input(“Enter the no of elements”)
For I in range(N):
Value =int(input(“Enter the value”))
List1.append(value)
Number = int(input(“Enter the element”)
Print(List1.count(Number)

6. Write a Python Program to find the largest and smallest numbers


in a list.
7. Write a Python Program to find the third largest number in a list.

You might also like