-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReviewFunctionList.py
More file actions
34 lines (31 loc) · 948 Bytes
/
ReviewFunctionList.py
File metadata and controls
34 lines (31 loc) · 948 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# O PROGRAMA CRIA E IMPRIME UMA LISTA COM OS NÚMEROS E TAMANHO INFORMADOS PELO USUÁRIO
# FEITO EM AULA 08-04
def tamanho_lista():
print("--TAMANHO DA LISTA--")
print("--------------------")
t = int(input("Tamanho da lista: "))
return t
def criar_lista(tamanho):
print("--CRIAR UM LISTA--")
print("--------------------")
lista = []
i=0
while i<tamanho:
n = int(input("Número: "))
lista.append(n)
i+=1
return lista
def imprimir(lista):
print("--IMPRIMIR A LISTA--")
print("--------------------")
for i in lista:
# print(i, end=' ') #imprime na mesma linha com espaço entre os numeros
print(f'Elemento: {i}') #quebra linhas imprimindo os numeros embaixo dos outros
def principal():
print("--PRINCIPAL--")
print("--------------------")
tamanho = tamanho_lista()
lista = criar_lista(tamanho)
imprimir(lista)
#PRINCIPAL
principal()