def main(): arya = Stark("Arya") print(arya.__dict__) arya.print_house_words() print(arya.is_alive) arya.die() print(arya.is_alive) print(arya.__doc__)
self.first_name = first_name self.is_alive = is_alive class Stark(GotCharacter): def __init__(self, first_name=None, is_alive=True): super().__init__(first_name=first_name, is_alive=is_alive) self.family_name = "Stark" self.house_words = "Winter is Coming" def print_house_words(self): print(self.house_words) def die(self): self.is_alive = False p1 = GotCharacter("Chbelan", True) print("{} {}\n".format(p1.first_name, p1.is_alive)) from game import GotCharacter, Stark arya = Stark("Arya", True) print(arya.__dict__) print(arya.is_alive) arya.print_house_words() arya.die() print(arya.is_alive)
#!/usr/bin/env python from game import GotCharacter, Stark ned = Stark("Ned") print(ned.__dict__) ned.print_house_words() ned.die() print(ned.is_alive) print(ned.__doc__)
# **************************************************************************** # # # # ::: :::::::: # # test.py :+: :+: :+: # # +:+ +:+ +:+ # # By: tbrizon <*****@*****.**> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2019/11/05 11:06:14 by tbrizon #+# #+# # # Updated: 2019/11/05 12:08:21 by tbrizon ### ########.fr # # # # **************************************************************************** # from game import GotCharacter, Stark if __name__ == "__main__": random = GotCharacter("Rando") print(random.character_id) random = Stark(random) print(random.familly_name, random.character_id) random = Stark(random) print(random.familly_name, random.character_id)