Advertisement
Guest User

escola

a guest
Sep 20th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. lst = []
  2. dic ={}
  3. opçao = ' '
  4.  
  5. while True:
  6. print('________CADASTRO DE ALUNOS______')
  7. dic.clear()
  8. nome = str(input('nome: '))
  9. idade =int(input('idade: '))
  10. nota =float(input('nota: '))
  11.  
  12. dic['nome']=nome
  13. dic['idade']=idade
  14. dic['nota']= nota
  15.  
  16. lst.append(dic.copy())
  17.  
  18. print('''O que deseja fazer?
  19. [A] cadastra.
  20. [B] listar cadastro.
  21. [C] sair.''')
  22. opçao = str(input('O que deseja fazer?.A,b ou C: ')).strip().upper()[0]
  23. while opçao not in 'ABC':
  24. opçao = str(input('NÃO INTENDIE!!!! \n O que deseja fazer?.A,b ou C: ')).strip().upper()[0]
  25. if opçao =='B':
  26. print(lst)
  27. break
  28. if opçao == 'C':
  29. break
  30.  
  31. for i in range(len(lst)):
  32. print(f'''CADASTRO ALUNO {i} :
  33. NOME:{lst[i]['nome']}
  34. IDADE: {lst[i]['idade']}
  35. NOTA: {lst[i]['nota']}''')
  36. print('#'*90)
  37. print('#'*90)
  38. print('FIM OBRIGADO !!!!!!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement