Professional Documents
Culture Documents
dic = {}
for i in string:
dic[i] = string.count(i)
print("Output:", dic)
d = {}
for i in range(n):
ke = input("Enter key")
va = input("Enter value")
d[ke] = va
print(d)
for i in d.values():
c=0
for j in d.values():
if i == j:
c += 1
if c == 2:
break
else:
for i in range(n):
t = ()
t += (name, salamt)
d[code] = t
print("CODE\tNAME\tSALESAMOUNT\tCOMMISSION")
for i in d:
c=0
c = d[i][1] * 0.1
else:
c = d[i][1] * 0.15
d = {}
n = int(input("Enter limit"))
for a in range(n):
t = []
t.append(input("Enter std"))
t.append(input("Enter section"))
d[k] = t
print("Enroll\t name\tMobile\tstd\tsection\n")
if en == ke:
val[1] = mno
break
else:
print("Modified dict", d)
d = {}
while True:
print("d. Exit")
n = int(input("Enter limit"))
for a in range(n):
d[k] = vot
if any(d):
for ke in sorted(d.keys()):
print(ke, d[ke])
else:
if any(d):
print(d[ke])
else:
break
else:
print("\nInvalid choice!!!")
Enter key1
Enter value10
Enter key'a'
Enter value20
Enter key1.5
Enter value30
Enter keyTrue
Enter value40
Enter key(1,2)
Enter value50
{'1': '10', "'a'": '20', '1.5': '30', 'True': '40', '(1,2)': '50'}
Enter code1
Enter namea
Enter code2
Enter nameb
Enter sales amount25700
Enter code3
Enter namec
1 a 12500.0 1875.0
2 b 25700.0 3855.0
3 c 8500.0 0
Enter limit3
Mobile number123456789
Enter std10
Enter sectionc
Mobile number987654321
Enter std11
Enter sectiond
Mobile number56431289
Enter std11
Enter sectiont
1 a 123456789 10 c
2 b 987654321 11 d
3 c 56431289 11 t
Mobile number098712
Modified dict {1: ['a', '123456789', '10', 'c'], 2: ['b', '987654321', '11', 'd'], 3: ['c', '56431289', '11', 't']}
a. Create a dictionary
d. Exit
Enter limit2
a. Create a dictionary
d. Exit
a 12
b 78
a. Create a dictionary
d. Exit
78
12
a. Create a dictionary
d. Exit