Professional Documents
Culture Documents
SET 1.
2. Write a python program to count the number of times a character appears in a given string.
4.exit
Set 2
Set 3:
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
4.exit
Set 4:
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:
1. Accept ‘n’ lines from the user and print the each line vowel count, digit count and length of the
line
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:
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. 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:
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
4.Exit
Set 9:
1.accept n numbers in a tuple and create another tuple to store Armstrong numbers and print
both the tuple
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
*******************************************************************************
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
4.Exit
CS PRACTICAL FILE 2022-23
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
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
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
*****************************************************************************
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}
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
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
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.
*********************************************************************************
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)
3.To take in a string as a input and replace every blank space with hyphen
4.Exit
*****************************************************************************
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
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
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
****************************************************************************
1.Write a menu driven program to create a list and search a particular element with its
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
1.A program which accepts an integer list and its size as parameters and rearranges the list and
prints it
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
*********************************************************************************
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
21 11 23 24
19 15 14 28
33 19 11 12
4.Exit
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
********************************************************************************