COMPUTER SCIENCE PROGRAM FILE QUESTIONS
SNO PROGRAMS
.
1 Write a program to store factorial of each element entered by
user into a tuple. Also, store the numbers entered in another
[Link] tuple of numbers and tuple of their factorials.
2 Write a program to store Fibonacci series in a tuple till the
range entered by user.
3 Write a program to create a user defined dynamic tuple and find
and print minimum and maximum element of the tuple. Do not
use built in functions.
4 Write a program to input values for two tuples. Print,
interchange, and compare the two tuples.(apply all comparision
operators and show results)
5 Write a program to create a user defined tuple, them perform a
linear search with flag and pos.
6 Write a menu driven program to input names of n students, total
marks, average and the result, and store them in a nested tuple
which displays the following menu:
(a) Result: Display name, marks, average and assign result
‘pass’ if average is more than and equal to 33 and ‘fail’ if it is
less than 33 (b)
Display: Display name, total marks, and average of all students
(c) Search: Input name as a parameter and display its details if
found; otherwise display not found
(d) Merit list: Display name of students having average marks
above 74.
7 Write a python program to input n names and phone numbers,
store them in a dictionary, and print the phone number of a
particular name after searching. If not found, print an
appropriate message.
8 Write a Python program to input names of n countries and their
capitals and currencies, store them in a dictionary and display
in tabular form. Search and display details of a
particular country. If not found, print an appropriate message.
9 Write a program to convert a number entered by the user into
its corresponding number in words for example, if the input is
985, then the output should be 'Nine Eight [Link] a
dictionary.
10 Write a program to accept and store employee name as a key
and their salary, allowance, and deduction as values in
dictionary 'Dict' for 10 employees. Display the following menu:
(a) Display total salary
(b) Display total allowance and deductions
(c) Search an employee
When the user selects option 1, display a report having
Name, Salary, Allowance, Deduction, Gross Salary
(Salary + Allowance), and Net Salary
(Gross Salary - Deductions)
When the user selects option 2, find total allowance and
deductions of all 10 employees.
When the user selects option 3, accept name of the
employee and search in the dictionary. If not found, print
an appropriate message.
When user selects option 4, ask for new data and append
a new pair with the entered data.
When user selects option 5,ask for the key and delete the
matching pair. If not found, print an appropriate message.
Option 6 is to exit the program.
11 Write a menu driven program to input your friends' names and
their phone numbers, and store them in the dictionary as key-
value pairs. Perform the following operations on the dictionary:
(a) Display the name and phone numbers of all your friends.
(b) Add a new key-value pair in this dictionary and display the
modified dictionary.
(c) Delete a particular friend's name from the dictionary.
(d) Modify the phone number of an existing friend.
(e) Check if a friend's name is present in the dictionary or not.
(f) Display the dictionary in sorted order of names.
(g) Exit
12 Write a Python program to input names of 'n' customers and
their details like items bought, cost and phone number. Store
them in a dictionary and display all the details in a tabular form.
13 Write a program that reads a line, counts the number of times
substring “is” appears in the line and then displays the count.
14 Write a program that reads a string and displays the
occurrence of words starting with a vowel in the given string.
15 Write a program that reads a string and displays the longest
substring of the given string.
16 Write a program to remove vowels from a string .
17 Write a program that reads the email ID of a person in the form
of a string and ensures that it belongs to domain @abc-
[Link](Assumption: There is no invalid characters in
the email id.)
18 Write a program to input a string having some digits and return
the sum of digits present in this string.
19 Write a program to count the number of vowels in a given
string .
20 Write a program that takes a sentence as an input parameter
where each word in the sentence is separated by a space. The
function should replace each blank with a hyphen and then
return the modified sentence.