Cs Prac (2) 222
Cs Prac (2) 222
CLASS: XII A
ROLL NO: 03
SCHOOL: Kendriya Vidyalaya Sector 5 Dwarka
PROGRAM 1
Write a menu driven program in python to display 4 Fibonacci series of a given no and print factorial of a given no using
functions.
OUTPUT:
PROGRAM 2
Write a menu driven code in python to check whether string entered by user is palindrome or not and number entered by
user is prime or not (using functions).
OUTPUT:
PROGRAM
3
Write a program to create dictionary that stores names and phone numbers. And to search phone number by using name
entered by user.
OUTPUT:
PROGRAM
4
Write a program to read a list of n integers(positive as well as negative). Create two new lists, one having all positive
numbers and zero and other list contains all negative numbers.
OUTPUT:
PROGRAM
5
Write a program to generate random numbers between 1 to 6 and check whether a user won a lottery or not.
OUTPUT:
PROGRAM
6
Write a program to count the number of vowels present in a text file(story.txt)
PROGRAM
7
Program to read the content of file line by line(test.txt) and write it to another File (poem.txt) except for the lines
containing letter 'a' in them.
PROGRAM
8
Program to read and display file content line by line with each word separated by '#'.
PROGRAM
9
Write a program to create binary file to store n values of Rollno and Name in the form of list , and also Search any Rollno
and display name if Rollno found otherwise “Rollno notfound”.
PROGRAM 10
Write a Program to create binary file to store Rollno,Name and Marks and update marks of entered Rollno.
PROGRAM 11
Write a Program to create binary file to store Rollno,Name and Marks and update marks of entered Rollno.
PROGRAM
12
Write a program to save some user id and passwords in a csv file. Ask user to enter a user id and password, if combination
matches it should print ‘welcome’ other wise print ‘data mismatch’.
PROGRAM
13
Write a menu driven program implementing user defined functions to perform functions on a csv file “student” such as