LightProgrammer000

Lista [5 nomes]

Aug 2nd, 2021 (edited)
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.82 KB | None | 0 0
  1. # Exercicio:
  2. # Crie uma funcao que adicione nomes de pessoas a uma lista, atraves de entrada no console,
  3. # e apos inserir 5 nomes chame outra funcao que imprima todos os nomes desta lista
  4. #
  5. # Biblioteca
  6. import os
  7.  
  8. ##########
  9. # FUNCAO #
  10. ##########
  11.  
  12. # Dados
  13. def dados():
  14.  
  15.     # Controle
  16.     i = 1
  17.     lista = []
  18.  
  19.     while i < 6:
  20.         lista.append(input(" {}) {}: ".format(i,"Nome")))
  21.         i += 1
  22.  
  23.     return lista
  24.  
  25. # Impressao do relatorio
  26. def relatorioLista(lista):
  27.  
  28.     print(" # {}".format("Relatorio"))
  29.  
  30.     for i in lista:
  31.         print(" # Nome: {}".format(i))
  32.  
  33. def main():
  34.  
  35.     # Sistema
  36.     os.system("clear")
  37.  
  38.     # Apresentacao
  39.     print("\n\033[01;36m {} Programa 19 {}\n\033[01;37m".format("=-=" * 5, "=-=" * 5))
  40.  
  41.     relatorioLista(dados())
  42.  
  43. if __name__ == '__main__':
  44.     main()
Add Comment
Please, Sign In to add comment