Program File
Made By – Rudransh Kandpal
class: XI – A
Roll No: 24
Program File
ACKNOWLEDGEMENT
We are greatly indebted to our teacher,
Ms. Urvashi Singhal
who throughout the tedious process of completion of the project
displayed with full patience and helped me tide over the
obstacles faced during this course by providing me with the
necessary council and encouragement at each step and pointed
out my various shortcomings in tackling these programs.
Student’s Signature Urvashi Singhal
Name: Rudransh Kandpal (HOD Computer Science)
Program File
Index
1. Write a program to input percentage marks of a student and
find the grade as per the following criterion:
Marks Grade
>=90 A
75-90 B
60-75 C
Below 60 D
2. Write a python menu-driven program to check whether the
number entered by user is a perfect number, Armstrong
number or a palindrome.
3. Write a python program to check whether number entered by
user is prime or composite.
4. Write a python program to display factorial of the entered
number.
5. Write a python program to generate Fibonacci series up to n
terms.
6. Write a python program to compute the greatest common
divisor and least common multiple of two integers.
7. Write a python program to generate the following pattern
using nested loops:
**
***
****
8. Write a python program to generate the following pattern
using nested loops:
12345
1234
123
12
1
Program File
9. Write a python program to generate the following pattern
using nested loops:
AB
ABC
ABCD
[Link] a python menu-driven program to count and display
the number of vowels, consonants, uppercase, lowercase
characters, digits and special characters in a string.
[Link] a python program to input a string and determine
whether it is a palindrome string or not.
[Link] a program that takes a string with multiple words and
then capitalizes the first letter of each word and forms a new
string out of it.
[Link] a python program to input a list of numbers and swap
elements at the even location with the elements at the odd
location.
[Link] a python program to search an element from the
entered list.
[Link] a Python program to remove an item from a tuple.
[Link] a program to input n numbers from the user. Store
these numbers in a tuple. Print the maximum, minimum, sum
and mean of number from this tuple.
[Link] a python program to accept a number from the user
and create a tuple containing all factors of a number.
[Link] a python program to create a dictionary with the roll
number, name and marks of n students in a class and display
the names of students who have marks above 75.
[Link] a program to input your friends’ names and their
Phone Numbers and store them in the dictionary as the key-
value pair. Perform the following operations on the
dictionary:
a) Display the name and phone number of all your friends
b) Add a new key-value pair in this dictionary and display the
modified dictionary
c) Delete a particular friend from the dictionary
Program File
d) Modify the phone number of an existing friend
e) Check if a friend is present in the dictionary or not
f) Display the dictionary in sorted order of names
[Link] a Python program to generate two random integers
between 500 and 760. Print the average of these numbers
along with these two numbers.
Q1 Write a program to input percentage marks of a student and
find the grade as per the following criterion:
Marks Grade
>=90 A
75-90 B
60-75 C
Below 60 D
SOURCE CODE
Program File
OUTPUT
Q2 Write a python menu-driven program to check whether the
number entered by user is a perfect number, Armstrong number
or a palindrome.
Program File
SOURCE CODE
Program File
OUTPUT
Program File
Q3 Write a python program to check whether number entered by
user is prime or composite.
SOURCE CODE
OUTPUT
Program File
Q4 Write a python program to display factorial of the entered
number.
SOURCE CODE
Output
Program File
Q5 Write a python program to generate Fibonacci series up to n
terms.
SOUCE CODE
OUTPUT
Program File
Q6 Write a python program to compute the greatest common
divisor and least common multiple of two integers.
SOURCE CODE
OUTPUT
Program File
Q7 Write a python program to generate the following pattern
using nested loops:
**
***
****
SOURCE CODE
OUTPUT
Program File
Q8 Write a python program to generate the following pattern
using nested loops:
12345
1234
123
12
SOURCE CODE
OUTPUT
Program File
Q9 Write a python program to generate the following pattern using nested loops:
A
AB
ABC
ABCD
SOURCE CODE
OUTPUT
Program File
Q10. Write a python menu-driven program to count and display the
number of vowels, consonants, uppercase, lowercase characters, digits
and special characters in a string.
SOURCE CODE
OUTPUT
Program File
Q11 Write a python program to input a string and determine whether it is
a palindrome string or not
SOURCE CODE
OUTPUT
Program File
Q12 Write a program that takes a string with multiple words and then capitalizes the first
letter of each word and forms a new string out of it.
SOURCE CODE
OUTPUT
Program File
Q13 Write a python program to input a list of numbers and swap elements at the even
location with the elements at the odd location.
SOURCE CODE
OUTPUT
Program File
Q14 Write a python program to search an element from the entered list
SOURCE CODE
OUTPUT
Program File
Q15 Write a Python program to remove an item from a tuple.
SOURCE CODE
OUTPUT
Program File
Q16 Write a program to input n numbers from the user. Store these numbers in a tuple. Print
the maximum, minimum, sum and mean of number from this tuple.
SOURCE CODE
OUTPUT
Program File
Q17 Write a python program to accept a number from the user and create a tuple containing
all factors of a number.
SOURCE CODE
OUTPUT
Q18 Write a python program to create a dictionary with the roll number, name and marks of
n students in a class and display the names of students who have marks above 75.
Program File
SOURCE CODE
OUTPUT
Q19 Write a program to input your friends’ names and their Phone Numbers and store them
in the dictionary as the key-value pair. Perform the following operations on the dictionary:
a) Display the name and phone number of all your friends
b) Add a new key-value pair in this dictionary and display the modified dictionary
Program File
c) Delete a particular friend from the dictionary
d) Modify the phone number of an existing friend
e) Check if a friend is present in the dictionary or not
f) Display the dictionary in sorted order of names
SOURCE CODE
OUTPUT
Q20 Write a Python program to generate two random integers between 500 and 760. Print
the average of these numbers along with these two numbers.
Program File
SOURCE CODE
OUTPUT