0
Create class using dictionary
Guys is there a way to convert a dictionary into a class without knowing the attributes of the class at first. For eg: Profile_dic = { 'Name' = 'Steve' , 'Age' = 25} Now use the above dictionary to create a class assuming I didn't know at first I would include the above keys and then store each profile created into a separate value in a new dictionary "All_profiles" with numbered keys as I did in the below code. I stored a class to a dictionary using the below code: https://code.sololearn.com/cr9ORpRoVCnl/?ref=app
1 Answer