Over time, teams from other Australian states were added to the
competition, which now has 18 teams and is called the Australian Football
Leaque (AFL). The finals series has been expanded to involve 8 teams, but
to keep things simple, we will assume there are still only four teams
Copyright By PowCoder代写 加微信 powcoder
playing in the Finals series.
The scoring works like this: teams can score Goals (worth 6 points) and
Behinds (worth 1 point). Hence a score of 10 Goals and 12 Behinds is a
total score of 72 points. This is written as 10.12 (72). As you probably
guessed, the winner is the team with the higher points score. A drawn
game (the scores are level) must be played again.
Also, each team has a home ground, and finals games will be played at the
home ground of the higher ranked team, except for the Grand Final, which
is always played at the MCG. The AFL teams and their home grounds (for
finals matches) are shown below.
Home Ground for Finals Games
the Adelaide Oval
Collingwood
Optus Stadium
Gold Coast
Greater Western Sydney Giants Stadium
North Melbourne
Port Adelaide
the Adelaide Oval
West Coast
Optus Stadium
Western Bulldogs
Write a Python program to do the following:
1. Take as the input a Python string made up of any four of the 18
teams, in the order they finished the regular season (highest first)
2. Test that the input is suitable: it contains four AFL teams.
3. Print out the location of each game, the winner of each game, and
each team’s score. If a game is drawn (meaning the scores are level),
print out the score of the first game and also the replayed game. (It
will be played at the same location).
To compute the score for each team, the home team’s Goals and Behinds
should take randomly generated integer values between 12 and 22. The
visiting team’s Goals and Behinds should take randomly generated integer
values between 10 and 20. (This is to allow for the advantage of the home
team playing in front of their supporters).
Also, the home team is always the higher ranked team, even for the Grand
final, where they might not be playing at their ground. For drawn games,
print out the higher ranked team’s score first.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com