Menu

(Solved) : Exercise 1 Python Dictionary 1 Write Function String2dict Takes Input String Returns Dicti Q33248470 . . .

Exercise 1. (Python)

Dictionary.

1-Write a function string2dict () which takes as inputa string and returns a dictionary matching each character appearingin the string with the number of its occurrences in the chain.

2-Then write a sortSelection () function that displaysthe dictionary in alphabetical order of letters (we will use eitherthe sorted (l) function which creates a new sorted list from a listl or the sort () method, which, when applied to an l.sort () list,sorts the list l) on the spot.

NumPy and matplotlib:

Expert Answer


Answer to Exercise 1 Python Dictionary 1 Write Function String2dict Takes Input String Returns Dicti Q33248470 . . .

OR