Doubt with Lists

0

When I type this command in the console, it returns me an empty list. But if I create a file and have it run, nothing appears, what happens? How should I do it?

lista = []

x = 1

while x > 0:
    x = int(input('digite um numero inteiro: '))
    lista.append(x)

print (lista)
    
asked by anonymous 23.06.2018 / 01:03

2 answers

1

At your terminal python3 nome_arquivo.py

    
23.06.2018 / 23:54
0

To run on the terminal use python nome_arquivo.py remembering that it should be in the same folder where the file is. I ran your script here and it worked perfectly.

    
28.06.2018 / 02:37