Guest User

Untitled

a guest
Dec 14th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.90 KB | None | 0 0
  1.     try:
  2.         while True:
  3.             decision_for_description = input("Do you want to add any description?\n").lower()
  4.             if decision_for_description == "yes" or decision_for_description == "y":
  5.                 while True:
  6.                     description = input("Please provide valid description of your product.\n")
  7.                     if len(description) > 255:
  8.                         print("Hey, maximum description length is 255 characters!")
  9.                     else:
  10.                         raise StopIteration
  11.             elif decision_for_description == "no" or decision_for_description == "n":
  12.                 description = ""
  13.                 break
  14.             else:
  15.                 print("Please choose yes or no.")
  16.     except StopIteration:
  17.         pass
  18.  
  19.     global product
  20.     product = (name, quantity, type, category, description)
  21.  
  22.     return display_ready_product()
Advertisement
Add Comment
Please, Sign In to add comment