Created
September 11, 2016 01:58
-
-
Save Spotik/d53e50b1b434a493b4bb264f296739f6 to your computer and use it in GitHub Desktop.
https://repl.it/D3iu/0 created by Spotik
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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