Quick actions

cmd+k|ctrl+k

Navigation

Languages

Class and Self

Snippet info

Language

Python

Visibility

public

Author

hopfat

Created

2026-07-06T02:03:35.005937Z

Updated

2026-07-06T08:28:15.520649Z

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()
INFO