|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
d_date1 = {'crucian carp' : [18, 10,.5], 'carp' : [8, 6,.2], 'silver carp' : [7, 4.7]}
d_date2 = {'草鱼' : [2, 7.2], '鲫鱼' : [3, 12], '黑鱼' : [6, 15]}
d_date3 = {'乌龟' : [1, 71], '鲫鱼' : [1, 9.8], '草鱼' : [5, 7.2], '黄鱼' : [2, 40]}
fish_records = {'1.1' :d_date1, '1.2' :d_date2, '1.3' :d_date3}
d_date1['鲫鱼'] = [17, 10.5]
del(d_date3['黄鱼'])
for get_name, get_L in d_date3.items():
get_L[1] = get_L[1] * 1.1
d_date3[get_name] = get_L
nums = 0
amount = 0
day = ' '
day_record = {}
for day, day_record in fish_records.items():
print('%s 钓鱼记录为: '%(day))
for name, sub_record in day_record.items():
nums += sub_record[0]
amount += sub_record[0] * sub_record[1]
print(' %s 数量%d, 单价%.2f元'%(name, sub_record[0], sub_record[1]))
print('钓鱼总数量为%d, 总金额为%.2f元'%(nums, amount))
|
|