还少一个函数,不知道怎么写。

dict_commodity_info = {
101: {'name': '屠龙刀', 'price': 10000},
102: {'name': '倚天剑', 'price': 10000},
103: {'name': '九阴白骨爪', 'price': 8000},
104: {'name': '九阳神功', 'price': 9000},
105: {'name': '降龙十八掌', 'price': 9500},
106: {'name': '乾坤大挪移', 'price': 10000},
}

list_order = [{'cid': 101, 'count': 2}]

def shopping():
'''
购物
:return:
'''
while True:
item = input('按1键购买,按2键结算。')
if item == 1:
buying() # 这里是函数调用
elif item == 2:
settlement() # 这里是函数调用

def buying():
'''
购买
:return:
'''
print_commodity_info() # 函数调用
order = create_order()
list_order.append(order)
print('添加到购物车')

def print_commodity_info():
'''
打印商品信息
:return:
'''
for key, value in dict_commodity_info.items():
print('编号:%d,名称:%s,单价:%d。' % (key, value['name'], value['price']))

def create_order():
'''
创建订单
:return: 字典类型的订单
'''
cid = input_commodity_id()
count = int(input('请输入要购买的数量:'))
order = {'cid': cid, 'count': count}
return order

def input_commodity_id():
'''
获取商品编号
:return:int类型,商品编号
'''
while True:
cid = int(input('请输入商品编号'))
if cid in dict_commodity_info:
return cid
print('商品信息不存在')

差啥函数?