FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-projects/python_projects_github/8_players_stats.py.py at main · QvIspe/python-projects · GitHub
QvIspe
/
python-projects
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
2
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-projects
/
python_projects_github
/
8_players_stats.py.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (44 loc) · 1.65 KB
Breadcrumbs
python-projects
/
python_projects_github
/
8_players_stats.py.py
Copy path
File metadata and controls
57 lines (44 loc) · 1.65 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
players
=
[
{
'name'
:
'Cristiano Ronaldo'
,
'position'
:
'Forward'
,
'jersey'
:
10
,
'goals'
:
25
,
'assists'
:
18
},
{
'name'
:
'Kevin De Bruyne'
,
'position'
:
'Midfielder'
,
'jersey'
:
17
,
'goals'
:
10
,
'assists'
:
22
},
{
'name'
:
'Virgil van Dijk'
,
'position'
:
'Defender'
,
'jersey'
:
4
,
'goals'
:
3
,
'assists'
:
2
},
{
'name'
:
'Thibaut Courtois'
,
'position'
:
'Goalkeeper'
,
'jersey'
:
1
,
'goals'
:
0
,
'assists'
:
0
}
]
positions
=
{
player
[
'position'
]
for
player
in
players
}
print
(
positions
)
for
player
in
players
:
if
player
[
'name'
]
==
'Cristiano Ronaldo'
:
player
[
'goals'
]
=
69
player
[
'assists'
]
=
30
print
(
players
)
statistic_goal
=
[]
for
player
in
players
:
statistic_goal
.
append
(
player
[
'goals'
])
statistic_assists
=
[]
for
player
in
players
:
statistic_assists
.
append
(
player
[
'assists'
])
print
(
statistic_goal
+
statistic_assists
)
avarage_goal
=
sum
(
statistic_goal
)
/
len
(
statistic_goal
)
avarage_assists
=
sum
(
statistic_assists
)
/
len
(
statistic_assists
)
print
(
avarage_goal
)
print
(
avarage_assists
)
def
add_player
():
name
=
input
(
"Введіть ім'я гравця: "
)
position
=
input
(
"Введіть позицію гравця: "
)
jersey
=
int
(
input
(
"Введіть номер на футболці: "
))
goals
=
int
(
input
(
"Введіть кількість голів: "
))
assists
=
int
(
input
(
"Введіть кількість асистів: "
))
player
=
{
'name'
:
name
,
'position'
:
position
,
'jersey'
:
jersey
,
'goals'
:
goals
,
'assists'
:
assists
}
players
.
append
(
player
)
add_player
()
print
(
players
)
Back
|
FazBrowse Home
|
New Git URL