Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bill = [] # Create an empty list variable
- how_many = input("How many things in your bill do you have? ")
- how_many = int(how_many)
- for thing_number in range(how_many): # Add a for loop with a range to loop x times
- thing = input("What is the thing number " + str(thing_number) + "? ") #Include each thing_number in the corresponding prompts to the user for bill things.
- bill.append(thing) # Append the thing to the list.
- print(bill) # After the for loop print the list.
- print "The things in the bill list : ",len (bill) # Function "len".
- count = 0
- for thing in bill:
- print(thing)
- count = count + 1 # Counter
- print(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement