Advertisement
timber101

Untitled

May 8th, 2019
271
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None
  1. count = 0 # shopping list count
  2.  
  3. how_many = input("how many items of shopping are there today? ")
  4. how_many = int(how_many)
  5. shopping = []
  6.  
  7.  
  8. for item_number in range(how_many): #  loop to input shopping items
  9.     item = input("What is the item number " + str(item_number) +" ? > ")
  10.     shopping.append(item)
  11.  
  12.  
  13. for item in shopping: # for loop to print out shopping
  14.     print(item)
  15.     count = count + 1
  16.  
  17. print("there are " + str(count) + " items in your trolly") # count tally
Advertisement
RAW Paste Data Copied
Advertisement