我试着用下面这样的代码做一个小型事务摘要:
price = {'mouse':10, 'hdd':60, 'rmd':23}
buying = {'mouse':3, 'hdd':2}
def total(price,buying):
print(sum(multiple = price.values() * buying.values()))
输出:
3 mouse : 30
2 hdd : 120
转载请注明出处:http://www.cshftz.com/article/20230526/2219816.html