-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex093.py
More file actions
28 lines (27 loc) · 1 KB
/
Copy pathex093.py
File metadata and controls
28 lines (27 loc) · 1 KB
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
'''
Crie um programa que gerencie o aproveitamento de um
jogador de futebol. O programa vai ler o nome do jogador
e quantas partidas ele jogou. Depois vai ler a quantidade de
gols feitos em cada partida. No final, tudo isso será guardado em um
dicionário, incluindo o total de gols durante o campeonato.
Obs: Aproveitamento deve ser uma lista, os gols nas partidas.
'''
futebol = {}
gol = []
totg = 0
futebol['Nome'] = str(input('Nome do jogador(a): '))
futebol['Partidas'] = int(input('Partidas jogadas: '))
for c in range(0, futebol['Partidas']):
gol.append(int(input(f'Gols na {c + 1}ª partida: ')))
futebol['Gols'] = gol[:]
futebol['Total de Gols'] = sum(gol)
print('='*30)
print(futebol)
print('='*30)
for k, v in futebol.items():
print(f'O campo {k} tem valor: {v}')
print('='*30)
print(f'O jogador(a) {futebol["Nome"]} jogou {futebol["Partidas"]} partidas.')
for i, c in enumerate(gol):
print(f'{"→":>5} Na {i + 1}ª partida fez: {c} gols.')
print(f'Foi um total de {futebol["Total de Gols"]} gols.')