我想知道如何将字符串列表转换为现有变量
示例:
from collections import defaultdict
d = defaultdict(lambda: defaultdict(dict))
def user_data(user_id, gst, total, uname, adress, service, quantity):
uyt = ['gst', 'total', 'uname', 'adress' 'service', 'quantity']
for r in uyt:
d[user_id][r]= r // where i want to pass it
if __name__ == '__main__':
user_data(1234, '8', "2345", 'mock', 'mumbai', 'fedx', '4' )