Write a progrWrite a program which creates a class named person with four methods. am which creates a class named person with four methods.
class Person:
def married(self):
print("You are married.")
def child(self):
print("You are a child.")
def adult(self):
print("You are an adult.")
def work(self):
print("You are working.")
p1=Person()
p1.adult()
p1.work()
Comments
Leave a comment