the prototype pattern speedattack_powerattack_rangeweapon )self life life self speed speed self attack_power attack_power self attack_range attack_range self weapon weapon def __str__(self)return "life{ }\ "speed{ }\ "attack power{ }\ "attack range{ }\ "weapon{ }formatself lifeself speedself attack_powerself attack_rangeself weapon class barracks(object)def generate_knight(self)return knight( "short sword"if __name__ ="__main__"barracks barracks(knight barracks generate_knight(print("[knight {}format(knight )running this code from the command line will create barracks instance of the barracks classand will then use that instance to generate knight which is just an instance of the knight class with values set for the properties we defined in the previous section running the code prints the following text to the terminal so you can check that the knight instance matches what you expect it to be based on the values set in the generate_knight function