scipiguy

Python 101: List challenge

Apr 22nd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. # Python 101 create list challenge
  2.  
  3. how_many = int(input("How many items of shopping do you have? "))
  4. shopping = []
  5.  
  6. for item_number in range(how_many):
  7.     item = input("What is item number " + str(item_number+1) + "? ")
  8.     shopping.append(item)
  9.  
  10. print("\nThe items in your list are:")
  11. for item in shopping:
  12.     print(item)
  13. print("You have " + str(how_many) + " items in your complete list:\n" + str(shopping))
Advertisement
Add Comment
Please, Sign In to add comment