Python Question Implement the Player class with necessary properties so that the given output is produced. Hints: First parameter of calculate_earning method is #played match and second parameter is #goal Earning of Forward = #played match * 400 + #goal * 50 Earning of Defender = #played match * 400 + #goal * 40 You can not change any of the given code. #Write your code here Player.player_info() print('1.========================================') ronaldo = Player("Ronaldo", "Man United") print('2.----------------------------------------') ronaldo.calculate_earning(5, 7) print('3.----------------------------------------') print(ronaldo) print('4.========================================') ramos = Player("Ramos", "PSG", "Defender") print('5.----------------------------------------') ramos.calculate_earning(5, 1) print('6.----------------------------------------') print(ramos) print('7.========================================') pogba = Player("Pogba", "Man United") print('8.----------------------------------------') pogba.calculate_earning(5) print('9.----------------------------------------') print(pogba) print('10.========================================') Player.player_info() Output: Total Number of Player: 0 Total Number of Forward: 0 Total Number of Defender: 0 1.======================================== Creating a Forward. 2.---------------------------------------- 3.---------------------------------------- Player No: 1 Name: Ronaldo Team: Man United Position: Forward Earning: 2350$ 4.======================================== Creating a Defender. 5.---------------------------------------- 6.---------------------------------------- Player No: 2 Name: Ramos Team: PSG Position: Defender Earning: 2040$ 7.======================================== Creating a Forward. 8.---------------------------------------- 9.---------------------------------------- Player No: 3 Name: Pogba Team: Man United Position: Forward Earning: 2000$ 10.======================================== Total Number of Player: 3 Total Number of Forward: 2 Total Number of Defender: 1
Python Question
Implement the Player class with necessary properties so that the given
output is produced.
Hints:
First parameter of calculate_earning method is #played match and second
parameter is #goal
Earning of Forward = #played match * 400 + #goal * 50
Earning of Defender = #played match * 400 + #goal * 40
You can not change any of the given code.
#Write your code here
Player.player_info()
print('1.========================================')
ronaldo = Player("Ronaldo", "Man United")
print('2.----------------------------------------')
ronaldo.calculate_earning(5, 7)
print('3.----------------------------------------')
print(ronaldo)
print('4.========================================')
ramos = Player("Ramos", "PSG", "Defender")
print('5.----------------------------------------')
ramos.calculate_earning(5, 1)
print('6.----------------------------------------')
print(ramos)
print('7.========================================')
pogba = Player("Pogba", "Man United")
print('8.----------------------------------------')
pogba.calculate_earning(5)
print('9.----------------------------------------')
print(pogba)
print('10.========================================')
Player.player_info()
Output:
Total Number of Player: 0
Total Number of Forward: 0
Total Number of Defender: 0
1.========================================
Creating a Forward.
2.----------------------------------------
3.----------------------------------------
Player No: 1
Name: Ronaldo
Team: Man United
Position: Forward
Earning: 2350$
4.========================================
Creating a Defender.
5.----------------------------------------
6.----------------------------------------
Player No: 2
Name: Ramos
Team: PSG
Position: Defender
Earning: 2040$
7.========================================
Creating a Forward.
8.----------------------------------------
9.----------------------------------------
Player No: 3
Name: Pogba
Team: Man United
Position: Forward
Earning: 2000$
10.========================================
Total Number of Player: 3
Total Number of Forward: 2
Total Number of Defender: 1
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)