I have an object User, and I have a dictionary of attributes that needs to be updated like data={'name':"Tom",'age':26}
I want to iterate over the dictionary and update it
Something like this:
for key,val in data.items():
user.key=val
The problem is it is saying user have no attribute as key. I want to replace user.key as user.name="Tom"
Any solution to it?