Professional Documents
Culture Documents
STD 11-Record Programs and Index
STD 11-Record Programs and Index
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
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.