Skip to content

Instantly share code, notes, and snippets.

@Spotik
Created September 11, 2016 01:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Spotik/d53e50b1b434a493b4bb264f296739f6 to your computer and use it in GitHub Desktop.
Save Spotik/d53e50b1b434a493b4bb264f296739f6 to your computer and use it in GitHub Desktop.
https://repl.it/D3iu/0 created by Spotik
'''Escreva um programa que leia um número N (obrigatoriamente entre 0 e 50) e em seguida leia N números reais em
uma lista A. Exiba a lista na tela, um elemento por linha.'''
numero = -1
lista = []
count = 0
while numero < 0 or numero > 50:
numero = input("Informe um número entre 0 e 50: ")
while count < numero:
x = input("Informe um número: ")
lista.append(x)
count += 1
count = 0
while count < len(lista):
print lista[count]
count += 1
Python 2.7.10 (default, Jul 14 2015, 19:46:27)
[GCC 4.8.2] on linux
Informe um número entre 0 e 50: 3
Informe um número: 1
Informe um número: 2
Informe um número: 3
1
2
3
=> None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment