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=Falseproduct_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:")
时间: 2024-10-21 15:11:16