Last active
June 2, 2020 23:32
-
-
Save bendominguez0111/16c2d5b3b31790b41b43a0b3b7a7356d to your computer and use it in GitHub Desktop.
Code for chapter two of Python for Fantasy Football.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Official player stats for 2019 | |
players = [{ | |
'name': 'Julio Jones', | |
'catches': 99, | |
'targets': 157 | |
}, | |
{ | |
'name': 'Davante Adams', | |
'catches': 83, | |
'targets': 127 | |
}, | |
{ | |
'name': 'Michael Thomas', | |
'catches': 149, | |
'targets': 185 | |
}, | |
] | |
for player in players: | |
name = player["name"] | |
catches = player["catches"] | |
targets = player["targets"] | |
catch_rate = catches/targets | |
print(name + ' has a catch rate of ' + str(catch_rate)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment