You are on page 1of 8

CS PRACTICAL FILE 2022-23

SET 1.

Write menu driven programme

1.To print the fibbonocci series upto the given term

2. Write a python program to count the number of times a character appears in a given string.

3. To print transpose of a matrix

4.exit

Set 2

Write menu driven programme to

1. find the sum of the series x+x^2/2!+x^4/4!+.... upto n terms


2. WAP to convert a number entered by the user into its corresponding number in words .For
example ,if the input is 678 then the output would be “ SIX SEVEN EIGHT”
3. Accept n no of strings in a list and print the vowel count, length of each string
4. exit

Set 3:

1.Write menu driven programme to

1.Accept n teams and number of games they have won ,and number of games they have lost as key
value pair and based on the above dictionary print the highest winner details

2.Print the sum of the series x+x2/2!+x3/3!.....n terms.

3.Accept n nos in a list and sort using insertion sort

4.exit

Set 4:

Write menu driven programme to

1. Write a program to print the series 3+6+12+24+.... upto t terms and print the sum

2. accept 10 numbers in a list and search for a number entered by the user using binary search

3. Accept a string and print the count of occurrence of each character in each string as key value
pair

4.exit

*******************************************************************************
CS PRACTICAL FILE 2022-23

Set 5:

Write menu driven programme to

1. Accept ‘n’ lines from the user and print the each line vowel count, digit count and length of the
line

2.TO print the sum of primary diagonals in the given matrix

3.Given the dictionary x={‘k1’:v1,’k2’:’v2’,’k3’:’v3’} create a dictionary with the opposite mapping ie :
resultdict={‘v1’:’k1’,’v2’:’k2’,’v3’:’k3’}

4.exit

****************************************************************************

Set 6:

1. Write menu driven programme to

a. To print the series 2/9-5/13+8/17... upto ‘n’ terms

b. WAP that takes a list of words and prints the longest word, shortestword

c. Create a dictionary to store 5 user names and passwords and search for a entered username and
print its password if not print the msg that user does not exist

d.exit

***************************************************************************

Set 7:

1. Write menu driven programme to

1. Accept ‘n’ numbers in a list and print the mean ,median and mode of the list

2.Accept matrix elements as nested list and print sum of rows and sum of column

3. Store 5 nobel prize winners in a list Nobel .Each element of the list is a tuple containing details of
1 nobel prize winner in the format of [ (“Name of the winner”,subject,year)]Write a program to sort
the list in the order of year using Insertion sort algorithm

4.exit
CS PRACTICAL FILE 2022-23

Set 8:

Write a menu driven program for

1. Accept n numbers in a tuple and swap even index and odd index as a nested tuple

2. Accept a long string and find the substring entered by the user using binary search

3.Print the sum of the series (10)+(10+12)+(10+12+14)+......................term t

4.Exit

Set 9:

Write a menu driven program for

1.accept n numbers in a tuple and create another tuple to store Armstrong numbers and print
both the tuple

2.To check if a dictionary is contained in another dictionary:

Eg if d1={1:11,2:12} d2={1:11,2:12,3:13,4:14} then d1 is contained in d2

3. Create a nested tuple to store 3 subjects marks for 5 students and print the student details who
has scored highest total

4. Exit

*******************************************************************************

Set 10:Write a menu driven program for

1. Accept n no of lines in a tuple and replace every blank space with hyphen in all the lines and
print count of number of replacement in each line

2. Accept ‘n’ numbers in a list and print the numbers in descending order using bubble sort

3. To find the sum of boundary elements of a matrix for eg if your matrix is:

11 12 23

15 14 17

29 10 11

Output should be : Sum of boundary elements: 128

4.Exit
CS PRACTICAL FILE 2022-23

Set 11:Write a menu driven program for

1.populate a list with 10 random numbers between the range of 100 to 500 and print largest even
and largest odd number in a list

2.Program that reads a line in a string and prints its statistics like

a) No of uppercase letters b)No of lowercase letters c) No of digits if any

d) No of special characters

3.To accept employee number,HRA, Allowance from the user for 5 employees in a dictionary and
print their total salary along with employee name

4.exit

Set 12:Write a menu driven program to

1. Accept a string and do the following:


a)To check whether the string has alphanumeric characters or not if yes print or print 0
b)To replace all the occurrence of letter ‘a’ in the string with ‘*’

2. Print the series x+x2/3+x4/5......n terms

3.To create a dictionary Company to store company name and IP address. The program should ask
the user to enter details according to user choice and display the address of the company along
with its name.

4.Exit

*****************************************************************************

Set 13:Write a menu driven program :

1.To create a dictionary D1 that has values in the form of lists of numbers.To create a new
Dictionary D2 having the same keys as D1 but values as the sum of the list elements eg:
D1={‘X’:[2,3,4],’Y’:[6,7,8]} then output should be :D2={‘X’:9,’Y’:21}

2. Generate and Find the sum of series for 10 terms.


99+80+63+........................to 10 terms

3.Write a program to input any string with multiple words and then capitalizes alternate word and
forms a new string from it

4. exit

*****************************************************************************
CS PRACTICAL FILE 2022-23

Set 14:Write a menu driven program :

1.A program that inputs two tuples s1,s2 and prints True if every element in s1 is also an element of
s2 else prints False

2.To accept 4 digit number swap the 1st and last digit,2nd and 3rd digit and print the final digit

3. To Generate dictionary of numbers and their squares from 1 to N numbers as key value pair

4.Exit

Set 15:Write a menu driven program :

1. Accept n numbers in Tuple and print equivalent binary numbers.

2.To delete all duplicate elements in a list and print only the unique list

3.To create a dictionary from the string .Eg: input: “ROBOTICSINAI” output should be:{‘R’:1,’O’:2
..........}

4. Exit.

*********************************************************************************

Set 16:Write a menu driven program :

1.To input friends names and their phone numbers and store them in dictionary and display the
names and phone numbers of those friends whose phone number ends in number 5(accept a 10
digit number as phone number)

2. Write a program to find the second largest number of a list of numbers.

3.To take in a string as a input and replace every blank space with hyphen

4.Exit

*****************************************************************************

Set17:Write a menu driven program :

1.To input names of 5 customers and details like customer number ,name and locality and store
them in dictionary and find and print if locality is present in dictionary or not and print “Not
found” if not available else print the details ,print total number of count of such records

2.To accept two strings and find whether they have equal number of characters .

3.To enter ’N’ numbers in a tuple Num and find the sum, maximum ,minimum values in the tuple.

4.Exit
CS PRACTICAL FILE 2022-23

Set 18:Write a menu driven program :

1.Accept data for nested list for m row an n column which stores integers and print each row sum
and each column sum

2.Program that takes a list of words and prints the longest word,shortestword,second longest word
and second shortest word using bubble sort

3.Program to input ‘n’ classes and names of their class teachers to store it in a dictionary and
display the same.Also accept a particular class from the user and display the name of the class
teacher of that class

4.Exit

Set 19:Write a menu driven program :

1.TO find the sum of diagonals elements of matrix.

3 4 5 6

1 2 3 4

2 5 8 9

2.To read a list of n integers (positive and negative).create two new lists one having all positive and
one having all negative numbers from the given list.Print all the three lists.

3. A list contains the names and marks of 15 students of a class. Create a Dictionary to count the
number of students who have scored more than 60 and those who have scored less than 33 marks

4.Exit

****************************************************************************

Set 20:Write a menu driven program :

1.Write a menu driven program to create a list and search a particular element with its

position in the list also print the factors of it.

2.TO count total number of vowels,consonants,in a long string

3.Program to store student names and their percentage in a dictionary,delete a particular student
name from the dictionary.Also display dictionary after deletion.

4.Exit
CS PRACTICAL FILE 2022-23

Set 21:Write a menu driven program :

Write a menu driven program

1.A program which accepts an integer list and its size as parameters and rearranges the list and
prints it

2.To count the number of times a letter appears in a long string

3.Write a program to take the number of students and marks for 5 subjects as input .if the total
marks for any student are less than 200 then print “failed” or print “passed”.Use a dictionary to
store the student name as key and marks as values.

4.Exit

*********************************************************************************

SET 22:Write a menu driven program :

1.Write a program to print the ASCII cod of all the characters of a word “COMPUTER” AS GIVEN
BELOW:

C O M P U T E R

67 79 77 80 85 84 69 82

2.Program to input names of ‘n’ customers and their details like items bought ,cost and phone
number ,store it in a dictionary and calculate total amount and display all the details in a tabular
format.

3.Accept a list to store n number of strings in it and create another list in the toggle case and print
the strings which has more than 5 letter word.
4.Exit

***************************************************************************
SET 23:Write a menu driven program :

1.Program to input names of ‘n’ employees ,employee number as key and their basic salary ,name
as values. Calculate Gross salary(Basic salary+HRA+CCA+DA),HRA-8%,CCA-2%,DA-23%
Note:HRA is calculated as 8% of the basic salary

2.To find the sum of middle column and middle row elements of matrix .
3.To find the largest and second largest number in a list
4. Exit
CS PRACTICAL FILE 2022-23

SET 24:Write a menu driven program :

Write a menu driven program for


1.To find the duplicate words in a string ,remove it and then print the strings without duplicates
2.To input ‘n’ names and phone numbers to store it in dictionary and print the phone number of a
particular name
3.. To print row and column sum of a matrix and print it

21 11 23 24

19 15 14 28

33 19 11 12

4.Exit

SET 25:Write a menu driven program :

Write a menu driven program for

1.Sort elements in ascending and descending order in a list and print

2.To print the sum of series x+2x+3x+....n terms

3.To input five students name and their total marks in a tuple. Find the highest mark and the name
of the student and print

4.Exit

********************************************************************************

You might also like