Write a program to convert string to dictionary and print it


Topic: Write a program to convert string to dictionary and print it

Solution

str = " Jan = January; Feb = February; Mar = March"
  
 
dictionary = dict(subString.split("=") for subString in str.split(";")) 
  
print(dictionary) 



List all Python Programs