Advertisement
Shahar_Goldenberg

Untitled

Oct 31st, 2021
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. from pprint import pprint
  2. products = {}
  3. cod = 0
  4.  
  5. def productsList():
  6.     while cod != "9999":
  7.         cod = input("Enter cod: ")
  8.         if len.cod != 4:
  9.             print("opps! the product isn't found, try agine")
  10.             productsList()
  11.         productName = input("Enter name: ")
  12.         price = int(input("Enter price: "))
  13.         products[cod] = [productName, price]
  14.         print(products[cod])
  15.  
  16.  
  17. while True:
  18.     print("\n1. Create a new products list\n \
  19. 2. See lists\n \
  20. 3. Quit\n")
  21.     userChoise = int(input())
  22.  
  23.     if userChoise == 1:
  24.         productsList()
  25.  
  26.     elif userChoise == 2:
  27.         print(AsStudents.keys)
  28.  
  29.     elif userChoise == 3:
  30.         quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement