result={'month_num':6,
'sales':[
{'month':'1月','sale':51},{'month':'2月','sale':19},
{'month':'3月','sale':22},{'month':'4月','sale':26},
{'month':'5月','sale':61},{'month':'6月','sale':90}
]
}
month=input("请输入要查找的月份:")
for i in result['sales']:
if i['month'] == month:
print("您查找的月份是{},销售额为{}万元".format(month,i['sale']))
遍历时的格式为i[‘元素’]
不能用['元素''元素']和['元素'(元素)]还有['元素']['元素']['元素']('元素')都是不行的


