import random
stuInfo = {}
for i in range(20):
name = 'westos' + str(i)
score = random.randint(60, 100)
stuInfo[name] = score
print(stuInfo)
highscore = {}
for name, score in stuInfo.items():
if score > 90:
highscore[name] = score
print(highscore)
print({name: score for name, score in stuInfo.items() if score > 90})
d = dict(a=1, b=2)
print(d)
new_d = {}
for i in d:
new_d[i.upper()] = d[i]
print(new_d)
print({k.upper(): v for k, v in d.items()})
d = dict(a=1, b=2, c=3, B=8, A=11)
# a:12 b:10 c:3
new_d = {}
for k, v in d.items():
low_k = k.lower()
if low_k not in new_d:
new_d[low_k] = v
else:
new_d[low_k] += v
print(new_d)
print({k.lower(): d.get(k.upper(), 0) +
d.get(k.lower(), 0) for k in d})