"""Solution to Ellen's Alien Game exercise."""classAlien:"""Create an Alien object with location x_coordinate and y_coordinate.
Attributes
----------
(class)total_aliens_created: int
x_coordinate: int - Position on the x-axis.
y_coordinate: int - Position on the y-axis.
health: int - Number of health points.
Methods
-------
hit(): Decrement Alien health by one point.
is_alive(): Return a boolean for if Alien is alive (if health is > 0).
teleport(new_x_coordinate, new_y_coordinate): Move Alien object to new coordinates.
collision_detection(other): Implementation TBD.
"""total_aliens_created=0def__init__(self,x_coordinate,y_coordinate):self.x_coordinate=x_coordinateself.y_coordinate=y_coordinateself.health=3Alien.total_aliens_created+=1defhit(self):self.health-=1ifself.health==0:self.health=0defis_alive(self):returnself.health>0defteleport(self,new_x,new_y):self.x_coordinate=new_xself.y_coordinate=new_ydefcollision_detection(self,other):pass#TODO: create the new_aliens_collection() function below to call your Alien class with a list of coordinates.
defnew_aliens_collection(alien_start_positions:list):aliens=[]foralieninalien_start_positions:new_alien=Alien(alien[0],alien[1])aliens.append(new_alien)returnaliens