PRyC WP: Add custom content to bottom of post/page: Standard Content START
Extra Credit- Fantasy Football
Who is ready for some football?
Your fantasy football draft is coming up and you are definetlygoing to win this year. You’ve got an edge on your oppentents this year: you have a super accurate forecast to how players are going to peform this year andyou have your coding skills!
Your league has the following rules:
You must select
– One quarterback
– Two running backs
– Two wide receivers
– One tight end
– One flex player (either a RB, a WR, or a TE)
In players.txt, there is a text file with the forecast for each player. Each player has their expected stats. It is formatted as follows:
Position Name PassingYards PassingTDs RushingYds RushingTDs ReceivingYds ReceivingTDs
Your job is to create the best team from the listed players using the following scoring:
You receive 1 point for each 25 yards of passing
Each passing TD is worth 4 points
You receive 1 point for each 10 yards of rushing
Each rushing TD is worth 6 points
You receive 1 point for each 10 yards of receiving
Each receiving TD is worth 6 points
Your code should output each position, each player, plus how many points they are expected to score, as such:
QB Mahomes 442
RB1 Gurley 309
RB2 Barkeley 292
WR1 Hill 244
WR2 Hopkins 223
FLEX Elliott 254
To learn more about how to read files in Python, you can read . You will also need to read up on how to use the split function in Python.
You can earn 20% extra credit by passing all of the test cases for this question.
Here is an example players.txt file you can use.
Other samples, services and questions:
When you use PaperHelp, you save one valuable — TIME
You can spend it for more important things than paper writing.