Skip to content

Instantly share code, notes, and snippets.

@bendominguez0111
Last active June 2, 2020 23:32
Show Gist options
  • Save bendominguez0111/16c2d5b3b31790b41b43a0b3b7a7356d to your computer and use it in GitHub Desktop.
Save bendominguez0111/16c2d5b3b31790b41b43a0b3b7a7356d to your computer and use it in GitHub Desktop.
Code for chapter two of Python for Fantasy Football.
#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