vivaladiva

Untitled

Oct 27th, 2020
571
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Initialize an empty list
  2. numbers = []
  3.  
  4. while True:
  5.   n = int(input("Enter a number or zero to quit: "))
  6.  
  7.   # If n is 0, exit the loop
  8.   if n == 0 :
  9.     break
  10.  
  11.   # Append n to the list
  12.   numbers.append(n)
  13.  
  14. # Print the list
  15. print(numbers)
RAW Paste Data