Computer Science, asked by shawsubham952, 6 months ago

Write a program in Python using function named Create(str) which takes a string as

argument and returns a dictionary by creating from that string as per following format.

Example string : 'w3resource'​

Answers

Answered by Anonymous
3

Answer:

you can simply use a = eval(a) to get a as object of dictionary from a string object.

...

It does 3 things:

split the string into "<key> - <value>" parts: s. split(',')

split each part into "<key> ", " <value>" pairs: item. split('-')

remove the whitespace from each pair: (k. strip(), v. strip())

good evening

it helps you

Similar questions