Class 12 Practical File Computer Science Term 1: Python Programming
Class 12 Practical File Computer Science Term 1: Python Programming
COMPUTER SCIENCE
TERM 1
PYTHON PROGRAMMING
1. Write python functions to perform the basic arithmetic operations in a menu-driven program.
2. Write a python program using a function to print Fibonacci series up to n numbers.
3. Write a python program using a function to print prime numbers between 11 to 200.
4. Write a function that takes a number n and then returns a randomly generated number having
exactly n digits (not starting with zero).
5. Write a function namely nthRoot() that receives two parameters x and n and returns nth root of x.
6. Recursively find the factorial of a natural number.
7. Write a recursive code to find the sum of all elements of a list.
8. Write a recursive code to compute the nth Fibonacci number.
9. Write a random number generator that generates random numbers between 1 and 6 (simulates a
dice).
10. Read a text file line by line and display each word separated by a #.
11. Read a text file and display the number of vowels/ consonants/uppercase/ lowercase characters in
the file.
12. 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.
13. Create a binary file with roll number, name and marks. Input a roll number and update the marks.
14. Remove all the lines that contain the character `a' in a file and write it to another file.
15. Take any sample text file and find most commonly occurring word(s).