Computer Science, asked by 2shrestha28, 8 months ago

2. Sort the following dictionary based on the keys so that they are sorted a to z. Assign the resulting value to the variable sorted_keys. PLEASE PROVIDE THE CODE dictionary = {"Flowers": 10, 'Trees': 20, 'Chairs': 6, "Firepit": 1, 'Grill': 2, 'Lights': 14} [PYTHON]

Answers

Answered by khushnoorsidhu318
0

-2

Because

10-4=6 ,6-4=2 , 2-4=-2

Answered by Anonymous
3

L = ['E', 'F', 'B', 'A', 'D', 'I', 'I', 'C', 'B', 'A', 'D', 'D', 'E', 'D']

d = {}

for x in L:

if x in d:

d[x] = d[x] + 1

else:

d[x] = 1

for x in d.keys():

print("{} appears {} times".format(x, d[x]))

Similar questions