Learning Necessities - Classes
So, would this be good enough knowledge of classes or should I leanrn more aboout it? Are these the methods classes mainly use and as a result I'm good on classes, I can move on? P.S. this is just so I'm prepared for college and I don't get even more stressed, Also covid is making me do this :/ idm tho its's fun. import datetime from itertools import count class Beginner_Pokemon(): Level = 5 _ids = count(0) def __init__(self,name,move_1,move_2): self.name = name self.move_1 = move_1 self.move_2 = move_2 #self.Moves = f'Move 1: {self.move_1} \nMove 2: {self.move_2}' self.id = next(self._ids) @property def Moves(self): return f'Move 1: {self.move_1} \nMove 2: {self.move_2}' @Moves.setter def Moves(self,new): move_1, move_2 = new.split(' ') self.move_1 = move_1 self.move_2 = move_2 @Moves.deleter def Moves(self): self.move_1 = None self.move_2 = None @classmethod def Pick_Level(cls,New_Level): cls.Level = New_Level @staticmethod def Time(): print(datetime.datetime.today()) def __repr__(self): return f"Beginner_Pokemon('{self.name}','{self.move_1}','{self.move_2}')" def __str__(self): return f"-Beginner Pokemon- \n{self.name} \nMove 1: {self.move_1} \nMove 2 {self.move_2}" class Sinnoh(Beginner_Pokemon): Nation = 'Sinnoh' def __init__(self,name,move_1,move_2,origin): super().__init__(name,move_1,move_2) self.origin = origin def __repr__(self): return f"Sinnoh('{self.name}','{self.move_1}','{self.move_2},'{self.origin}'' - Sinnoh(Beginner_Pokemon)" def __str__(self): return f"Name: {self.name} \nMove_1: {self.move_1} \nMove_2: {self.move_2} \nOrigin: {Sinnoh.Nation}: {self.origin}" Piplup = Sinnoh('Piplup','Pound','Leer','Oak Town') Chimchar = Sinnoh('Chimchar','Scratch','Leer','Twinleaf Town') Snivy = Beginner_Poke