You are on page 1of 2

CHETTINAD VIDYASHRAM

STD 11- III TERM RECORD PROGRAMS (2023-24)

1. Write a program to create a dictionary from a string. In dictionary, key is the letter and
value is the count of occurrence of each letter.
Eg: string: ‘w3resource’
Expected output: {‘w’:1,’3’:1,’r’:2,’e’:2,’s’:1,’o’:1,’u’:1,’c’:1}

2. Create a dictionary to accept N key: value pairs. Print ‘2 keys have same values’ if any
two keys have same value otherwise print ‘No keys have same values’.
Eg1: D1={ (1,3):6,’A’:23,’D’:10,’B’:23} # 2 keys have same values
Eg2: D2={‘B’:23,2:True,(4,4):12 } # No keys have same values

3. Create a dictionary with Code as key, value as a tuple (Name, Salesamount) of N number
of salesmen. Calculate the commission on the following basis:
Salesamount Commission(% of salesamount)
<10000 0
>=10000 and <=30000 10
>30000 15

Print the details in tabular format with heading:


S.No: Code Name Sales amount Commission

4. Write a program to input Enrol as key and Name, MobileNo, Standard, Section as values
of List for N number of students in a dictionary. Input an enroll, search and modify the
MobileNo. Print the modified dictionary.

5. Accept the choice and do the following:


a. Create a dictionary Election whose keys are ‘candidate name’ and whose values are
the ‘number of votes received’ for N candidates.
b. Display the details in ascending order of candidate names (key) using sorted function.
c. Display the details in descending order of votes received (value) using sorted
function.
III TERM

S.NO DATE INDEX PAGE NO. T.SIGN

COUNTING THE FREQUENCY OF LETTERS


1 09/01/24
IN A STRING USING DICTIONARY

FINDING IDENTICAL VALUES FOR KEYS IN


2 09/01/24
DICTIONARY

CALCULATING COMMISSION USING TUPLE


3 23/01/24
AND DICTIONARY

SEARCH AND UPDATE VALUES IN


4 23/01/24
DICTIONARY

5 23/01/24 SORTING KEY:VALUE IN DICTIONARY

You might also like