Design the Team and Player class so that the following expected output is generated
Design the Team and Player class so that the following expected output is generated. #Write your code here team = Team("Bangladesh") p1 = Player("Mahmudullah", "Batsman",30) print("=================================") team.addPlayer(p1) print("=================================") team.showPlayers() print("=================================") p2 = Player("Mustafizur Rahman", "Bowler",90) p3 = Player("Tamim Iqbal", 28) print("=================================") team.addPlayer(p2, p3) print("=================================") team.showPlayers() print("=================================") p3.setRole("Batsman") print("=================================") team.addPlayer(p3) print("=================================") team.showPlayers() print("=================================") p4 = Player("Mushfiqur Rahim", "Batsman",15) p5 = Player("Taskin Ahmed", "Bowler",3) print("=================================") team.addPlayer(p4, p5) print("=================================") team.showPlayers() Expected Output: ================================= Mahmudullah added in team ================================= Total players: 1 Batsman: Player name: Mahmudullah Jersey No: 30 ================================= ================================= Mustafizur Rahman added in team A player cannot be added without a role. ================================= Total players: 2 Batsman: Player name: Mahmudullah Jersey No: 30 Bowler: Player name: Mustafizur Rahman Jersey No: 90 ================================= ================================= Tamim Iqbal added in team ================================= Total players: 3 Batsman: Player name: Mahmudullah Jersey No: 30 Player name: Tamim Iqbal Jersey No: 28 Bowler: Player name: Mustafizur Rahman Jersey No: 90 ================================= ================================= Mushfiqur Rahim added in team Taskin Ahmed added in team ================================= Total players: 5 Batsman: Player name: Mahmudullah Jersey No: 30 Player name: Tamim Iqbal Jersey No: 28 Player name: Mushfiqur Rahim Jersey No: 15 Bowler: Player name: Mustafizur Rahman Jersey No: 90 Player name: Taskin Ahmed Jersey No: 3
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 5 images