Help me asap and please use python Implement the HogwartsQuidditchSquad class derived from the Squad class with necessary variables and methods so that the expected output is  generated. Do not change any given code. [Hint: In order to form a squad, you need at least 5 members. And in order  to form a perfect squad you need 2 beaters, 1 seeker, 1 chaser and 1  keeper. ] class Squad:      playerCount=0      def __init__(self,name,squadType):          self.name = name          self.squadType = squadType      def formSquad(self):          if Squad.playerCount >= 5:              return True          else:              return False      def __str__(self):          s = f"{self.name} is a {self.squadType} team.\n"          s+= f"Number of players in {self.name} is {Squad.playerCount}\n"          return s #Write your code here f = HogwartsQuidditchSquad("Hogwart's Dragons","Quidditch") f.addPlayer(["Harry Potter","Seeker","Gryffindor"],["Katie  Bell","Chaser","Gryffindor"]) print("1.====================================") print(f) print("2.====================================") f.formSquad() print("3.====================================") f.addPlayer(["Vincent Crabbe","Beater","Slytherin"]) f.addPlayer(["Miles Bletchley","Keeper","Slytherin"]) print("4.====================================") print(f) print("5.====================================") f.formSquad() print("6.====================================") f.addPlayer(["Ethan Humberstone","Keeper","Hufflepuff"]) f.formSquad() print("7.====================================") f.addPlayer(["Fred Weasley","Beater","Gryffindor"]) print(f) print("8.====================================") f.formSquad() Output: 1.==================================== Hogwart's Dragons is a Quidditch team. Number of players in Hogwart's Dragons is 2 The Players are: Seeker: Player name: Harry Potter, House: Gryffindor Chaser: Player name: Katie Bell, House: Gryffindor 2.==================================== We do not have enough players to form a squad. 3.==================================== 4.==================================== Hogwart's Dragons is a Quidditch team. Number of players in Hogwart's Dragons is 4 The Players are: Seeker: Player name: Harry Potter, House: Gryffindor Chaser: Player name: Katie Bell, House: Gryffindor Beater: Player name: Vincent Crabbe, House: Slytherin Keeper: Player name: Miles Bletchley, House: Slytherin 5.==================================== We do not have enough players to form a squad. 6.==================================== We have enough players to form a squad. But we cannot form a perfect squad. 7.==================================== Hogwart's Dragons is a Quidditch team. Number of players in Hogwart's Dragons is 6 The Players are: Seeker: Player name: Harry Potter, House: Gryffindor Chaser: Player name: Katie Bell, House: Gryffindor Beater: Player name: Vincent Crabbe, House: Slytherin Player name: Fred Weasley, House: Gryffindor Keeper: Player name: Miles Bletchley, House: Slytherin Player name: Ethan Humberstone, House: Hufflepuff 8.==================================== We have enough players to form a squad. Also we can form a perfect squad!!

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Help me asap and please use python

Implement the HogwartsQuidditchSquad class derived from the Squad class with necessary variables and methods so that the expected output is 
generated. Do not change any given code. [Hint: In order to form a squad, you need at least 5 members. And in order  to form a perfect squad you need 2 beaters, 1 seeker, 1 chaser and 1  keeper. ]

class Squad:
     playerCount=0
     def __init__(self,name,squadType):
         self.name = name
         self.squadType = squadType
     def formSquad(self):
         if Squad.playerCount >= 5:
             return True
         else:
             return False
     def __str__(self):
         s = f"{self.name} is a {self.squadType} team.\n"
         s+= f"Number of players in {self.name} is {Squad.playerCount}\n"
         return s

#Write your code here
f = HogwartsQuidditchSquad("Hogwart's Dragons","Quidditch")
f.addPlayer(["Harry Potter","Seeker","Gryffindor"],["Katie 
Bell","Chaser","Gryffindor"])
print("1.====================================")
print(f)
print("2.====================================")
f.formSquad()
print("3.====================================")
f.addPlayer(["Vincent Crabbe","Beater","Slytherin"])
f.addPlayer(["Miles Bletchley","Keeper","Slytherin"])
print("4.====================================")
print(f)
print("5.====================================")
f.formSquad()
print("6.====================================")
f.addPlayer(["Ethan Humberstone","Keeper","Hufflepuff"])
f.formSquad()
print("7.====================================")
f.addPlayer(["Fred Weasley","Beater","Gryffindor"])
print(f)
print("8.====================================")
f.formSquad()


Output:
1.====================================
Hogwart's Dragons is a Quidditch team.
Number of players in Hogwart's Dragons is 2
The Players are:
Seeker:
Player name: Harry Potter, House: Gryffindor
Chaser:
Player name: Katie Bell, House: Gryffindor
2.====================================
We do not have enough players to form a squad.
3.====================================
4.====================================
Hogwart's Dragons is a Quidditch team.
Number of players in Hogwart's Dragons is 4
The Players are:
Seeker:
Player name: Harry Potter, House: Gryffindor
Chaser:
Player name: Katie Bell, House: Gryffindor
Beater:
Player name: Vincent Crabbe, House: Slytherin
Keeper:
Player name: Miles Bletchley, House: Slytherin
5.====================================
We do not have enough players to form a squad.
6.====================================
We have enough players to form a squad.
But we cannot form a perfect squad.
7.====================================
Hogwart's Dragons is a Quidditch team.
Number of players in Hogwart's Dragons is 6
The Players are:
Seeker:
Player name: Harry Potter, House: Gryffindor
Chaser:
Player name: Katie Bell, House: Gryffindor
Beater:
Player name: Vincent Crabbe, House: Slytherin
Player name: Fred Weasley, House: Gryffindor
Keeper:
Player name: Miles Bletchley, House: Slytherin
Player name: Ethan Humberstone, House: Hufflepuff
8.====================================
We have enough players to form a squad.
Also we can form a perfect squad!!

Implement the HogwartsQuidditchSquad class derived from the Squad class
with necessary variables and methods so that the expected output is
generated. Do not change any given code.
[Hint: In order to form a squad, you need at least 5 members. And in order
to form a perfect squad you need 2 beaters, 1 seeker, 1 chaser and 1
keeper. ]
class Squad:
playerCount=0
def_init_(self,name.squadType):
self.name = name
self.squadType = squadType
def formSquad(self):
if Squad.playerCount >= 5:
return True
else:
return False
def_str_(self):
s= f'{self.name} is a (self.squadType) team.In"
s+= F'Number of players in {self.name} is (Squad.playerCount}\n"
return s
#Write your code here
f = HogwartsQuidditchSquad("Hogwart's Dragons","Quidditch")
f.addPlayer(["Harry Potter"."Seeker", "Gryffindor").["Katie
Bell","Chaser","Gryffindor"])
print("1.
print(f)
print("2.==
f.formSquad()
print("3.====E=
f.addPlayer(["Vincent Crabbe", "Beater". "Slytherin")
f.addPlayer(["Miles Bletchley", "Keeper", "Slytherin'])
print("4.===
print(f)
print("5.===
=====")
f.formSquad()
print("6.======
f.addPlayer(["Ethan Humberstone","Keeper", "Hufflepuff")
f.formSquad()
====="}
print("7.========
=====")
f.addPlayer(["Fred Weasley","Beater", "Gryffindor"))
print(f)
print("8.===
===")
f.formSquad()
Transcribed Image Text:Implement the HogwartsQuidditchSquad class derived from the Squad class with necessary variables and methods so that the expected output is generated. Do not change any given code. [Hint: In order to form a squad, you need at least 5 members. And in order to form a perfect squad you need 2 beaters, 1 seeker, 1 chaser and 1 keeper. ] class Squad: playerCount=0 def_init_(self,name.squadType): self.name = name self.squadType = squadType def formSquad(self): if Squad.playerCount >= 5: return True else: return False def_str_(self): s= f'{self.name} is a (self.squadType) team.In" s+= F'Number of players in {self.name} is (Squad.playerCount}\n" return s #Write your code here f = HogwartsQuidditchSquad("Hogwart's Dragons","Quidditch") f.addPlayer(["Harry Potter"."Seeker", "Gryffindor").["Katie Bell","Chaser","Gryffindor"]) print("1. print(f) print("2.== f.formSquad() print("3.====E= f.addPlayer(["Vincent Crabbe", "Beater". "Slytherin") f.addPlayer(["Miles Bletchley", "Keeper", "Slytherin']) print("4.=== print(f) print("5.=== =====") f.formSquad() print("6.====== f.addPlayer(["Ethan Humberstone","Keeper", "Hufflepuff") f.formSquad() ====="} print("7.======== =====") f.addPlayer(["Fred Weasley","Beater", "Gryffindor")) print(f) print("8.=== ===") f.formSquad()
Output:
1.===
Hogwart's Dragons is a Quidditch team.
Number of players in Hogwart's Dragons is 2
The Players are:
Seeker:
Player name: Harry Potter, House: Gryffindor
Chaser.
Player name: Katie Bell, House: Gryffindor
2==============
%3%=====
We do not have enough players to form a squad.
3.=============================
=====
4.=======
===============
Hogwart's Dragons is a Quidditch team.
Number of players in Hogwart's Dragons is 4
The Players are:
Seeker:
Player name: Harry Potter, House: Gryffindor
Chaser.
Player name: Katie Bell, House: Gryffindor
Beater:
Player name: Vincent Crabbe, House: Slytherin
Кeeper.
Player name: Miles Bietchley. House: Slytherin
5.====================================
We do not have enough players to form a squad.
6.=============================
We have enough players to fom a squad.
But we cannot form a perfect squad.
7.==================---I------
%3==
Hogwart's Dragons is a Quidditoh team.
Number of players in Hogwart's Dragons is 6
The Players are:
Seeker:
Player name: Harry Potter, House: Gryffindor
Chaser.
Player name: Katie Bell, House: Gryffindor
Beater:
Player name: Vincent Crabbe, House: Siytherin
Player name: Fred Weasley. House: Gryffindor
Кeeper.
Player name: Miles Bletchley. House: Slytherin
Player name: Ethan Humberstone, House: Hufflepuff
8.====================================
We have enough players to form a squad.
Also we can form a perfect squad!
Transcribed Image Text:Output: 1.=== Hogwart's Dragons is a Quidditch team. Number of players in Hogwart's Dragons is 2 The Players are: Seeker: Player name: Harry Potter, House: Gryffindor Chaser. Player name: Katie Bell, House: Gryffindor 2============== %3%===== We do not have enough players to form a squad. 3.============================= ===== 4.======= =============== Hogwart's Dragons is a Quidditch team. Number of players in Hogwart's Dragons is 4 The Players are: Seeker: Player name: Harry Potter, House: Gryffindor Chaser. Player name: Katie Bell, House: Gryffindor Beater: Player name: Vincent Crabbe, House: Slytherin Кeeper. Player name: Miles Bietchley. House: Slytherin 5.==================================== We do not have enough players to form a squad. 6.============================= We have enough players to fom a squad. But we cannot form a perfect squad. 7.==================---I------ %3== Hogwart's Dragons is a Quidditoh team. Number of players in Hogwart's Dragons is 6 The Players are: Seeker: Player name: Harry Potter, House: Gryffindor Chaser. Player name: Katie Bell, House: Gryffindor Beater: Player name: Vincent Crabbe, House: Siytherin Player name: Fred Weasley. House: Gryffindor Кeeper. Player name: Miles Bletchley. House: Slytherin Player name: Ethan Humberstone, House: Hufflepuff 8.==================================== We have enough players to form a squad. Also we can form a perfect squad!
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY