Advertisement

shopping list example

阅读量:
复制代码
 __auther__ = "ABC"

    
  
    
 product_list = [
    
     ("Iphone",5800),
    
     ("IPAD",3800),
    
     ("Iwatch",12800),
    
     ("Coffee",28),
    
 ]
    
  
    
 salary = input("Input your salary:")
    
 if salary.isdigit():
    
     salary = int(salary)
    
     while True:
    
     for item in product_list:
    
         print(product_list.index(item),item)
    
     break
    
    
    
    
复制代码
 C:\Users\Amber\PycharmProjects\pythonProject\venv\Scripts\python.exe C:/Users/Amber/PycharmProjects/pythonProject/CH01/shopping_cart.py

    
 Input your salary:2000

全部评论 (0)

还没有任何评论哟~