CLASS XII
SUBJECT – COMPUTER SCIENCE
HOLIDAY HOMEWORK
(Report file: 15 Python programs)
1. Determine whether a number is a perfect number or not.
2. Input a number and check if the number is a prime or composite
number.
3. Compute the greatest common divisor and least common multiple of
two integers.
4. Write a program to input the value of x and n and print the sum of the
following series:
5. Input a tuple of elements, search for a given element in the tuple.
6. Input a list of numbers and find the smallest and largest number from
the list.
7. Create a dictionary with the roll number, name and marks of n students
in a class and display the names of students who have scored marks
above 75.
8. Read a text file line by line and display each word separated by a #.
9. Read a text file and display the number of
vowels/consonants/uppercase/lowercase characters in the file.
10.Remove all the lines that contain the character 'a' in a file and write it to
another file.
11.Create a binary file with name and roll number. Search for a given roll
number and display the name, if not found display appropriate message.
12.Create a binary file with roll number, name and marks. Input a roll
number and update the marks.
13.Write a random number generator that generates random numbers
between 1 and 6 (simulates a dice).
14.Write a Python program to implement a stack using list.
15.Create a CSV file by entering user-id and password, read and search the
password for given user- id.