Listing 06-06: Adding elements to the list

##############################################################################
# Python From Scratch
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2024
# Site: https://pythonfromscratch.com
#
# File: listing\chapter 06\06.06 - Adding elements to the list.py
# Description: Adding elements to the list
##############################################################################

L = []
while True:
    n = int(input("Enter a number (0 exits):"))
    if n == 0:
        break
    L.append(n)
x = 0
while x < len(L):
    print(L[x])
    x += 1
Click here to download the file