Generation

generate functionSun, 13 Nov 2022

function to store attributes for an object

class Person: def __init__(self, name, age): self.name = name self.age = age def myfunc(self): print("Hello my name is " + self.name) p1 = Person("John", 36) p1.myfunc()

Questions about programming?Chat with your personal AI assistant