Creating Our Own Objects

Run Settings
LanguagePython
Language Version
Run Command
class PlayerChar: def __init__(self, name, age): self.name = name #attributes self.age = age def run(self): print('run') player1 = PlayerChar('Cindy', 44) player1.attack = 75 player2 = PlayerChar('Thomas', 27) player3 = PlayerChar('Bobbi', 32) print(player1.name) print(player1.age) print(player2.name) print(player2.age) print(player3.name) print(player3.age) print(player1.attack) print(player1) print(player2) print(player3)
Editor Settings
Theme
Key bindings
Full width
Lines