Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- time = list()
- partidas = list()
- jogador = dict()
- while True:
- print("-=-"*25)
- jogador['nome'] = str(input("Nome do jogador: "))
- tot = int(input(f"Quantas partidas o {jogador['nome']} jogou? "))
- partidas.clear()
- for a in range(0, tot):
- partidas.append(int(input(f" Quantos gols na partida {a+1}? ")))
- jogador['gols'] = partidas[:]
- jogador['total'] = sum(partidas)
- time.append(jogador.copy())
- while True:
- resp = str(input("Quer continuar?[S/N]")).upper()
- if resp in "SsNn":
- break
- print("ERRO! Responda apenas S ou N.")
- if resp in "Nn":
- break
- print("-=-"*40)
- print("cod", end = ' ')
- for i in jogador.keys():
- print(f"{i:<15}", end = ' ')
- print("")
- for b, c in enumerate(time):
- print(f"{b:>3}", end = ' ')
- for d in c.values():
- print(f"{str(d):<15}", end = ' ')
- print()
- print("-=-"*40)
- while True:
- busca = int(input("Mostrar dados de qual jogador?(999 para parar) "))
- if busca == 999:
- break
- if busca >= len(time):
- print(f"ERRO!! Não existe jogador com o códito {busca}")
- else:
- print(f" -- LEVANTAMENTO DO JOGADOR {time[busca]['nome']}: ")
- for i, g in enumerate(time[busca]['gols']):
- print(f" No jogo {i+1} fez {g} gols.")
- print("<<<<< FIM DO CÓDIGO >>>>>")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement