class naredra: def __init__(self,brand , model): self._brand= brand self.model = model def display(self): print(f"Brand:{self._brand},Model:{self.model}") n1 = naredra("narendra",3) #print(n1.brand) #print(n1.model) n1.display()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter