Class and Self

Run Settings
LanguagePython
Language Version
Run Command
class Car: def __init__(self,carno,cartype): self.carno = carno self.cartype = cartype def info(self): print(f"The Car No{self.carno} is typed as {self.cartype}") def lost(self): print(f"The Car No{self.carno} is not found!") CA=Car("JH4535","SUV") CA.info() CB=Car("KG7374","Limousine") CB.info() C3=Car("FU6585","Lamborghini") C3.info() CC=Car("BK7568","Ford") CC.lost()
Editor Settings
Theme
Key bindings
Full width
Lines