Question: Gain experience manipulating lists. Continue gaining experience using functions, iteration and boolean expressions. Background In a soccer match, a win is worth 3 points, a

Gain experience manipulating lists.
Continue gaining experience using functions, iteration and boolean expressions.
Background
In a soccer match, a win is worth 3 points, a tie is worth 1 point, and a loss is worth 0 points. Replace the pass construct in each function with the necessary Python code. There will always be at least one legal combination of wins, ties and losses.
Grading -10 points
2 points - The output format is matched exactly.
8 points - Your program will be graded using a different value for soccer_seasons. For each season that produces the correct output, you will earn 1 point.
example output:
Season: 1, Games Played: 1, Points earned: 3
Possible Win-Tie-Loss Records
-----------------------------
1-0-0
Season: 2, Games Played: 1, Points earned: 1
Possible Win-Tie-Loss Records
-----------------------------
0-1-0
Season: 3, Games Played: 1, Points earned: 0
Possible Win-Tie-Loss Records
-----------------------------
0-0-1
Season: 4, Games Played: 20, Points earned: 30
Possible Win-Tie-Loss Records
-----------------------------
10-0-10
9-3-8
8-6-6
7-9-4
6-12-2
5-15-0
python code:
def process_season(season, games_played, points_earned):
print("Season: "+ str(season)+", Games Played: "+ str(games_played)+
", Points earned: "+ str(points_earned))
print("Possible Win-Tie-Loss Records")
print("-----------------------------")
pass
print()
# --------------------------------------
def process_seasons(seasons):
pass
# --------------------------------------
def main():
# format of list: [[season-1-games, season-1-points],[season-2-games, season-2-points], etc.]
soccer_seasons =[[1,3],[1,1],[1,0],[20,30]]
process_seasons(soccer_seasons)
print(soccer_seasons)
print(process_season)
# --------------------------------------
main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!