标签:exit lex iphone one welcome index git name 死循环
salary=input("input you salary:")
if salary.isdigit():
salary=int(salary)
else:
exit("invaild data type...")
welcome=‘welcom to alex shopping more‘.center(50,‘-‘)
print(welcome)
exit_flag=False
product_list = [
(‘iphone‘,5888),
(‘mac air‘,8000),
(‘Xiao mi‘,1999),
(‘coffee‘,30),
(‘tesla‘,820000),
(‘bike‘,800),
(‘cloth‘,200),]
while exit_flag is not True:
print(‘product_list‘.center(50,‘-‘))
for item in enumerate(product_list):
index=item[0]
p_name=item[1][0]
p_price=item[1][1]
print(index,p_name,p_price,)
print("what do you choice:")
标签:exit lex iphone one welcome index git name 死循环
原文地址:http://www.cnblogs.com/wangjigang/p/6046932.html