I want to create a new object of a certain class. I can do it this way:
user = Users(name=lst['name'],
email=lst['email'],
surname=lst['surname'])
lst
is dictionary and each instance of lst
could has diffrent fields. For example, it could look like this:
lst = {'name': 'John', 'email': 'john@mail.com', 'surname': 'Jang'}
but it can also look:
lst = {'name': 'John', 'phone': '00000000'}
I want to make a function which will handle list as explained above. Is there exist a way to do it in python?