class Person():
def __init__(self, name):
self.name = name
def talk(self, text=None):
if text is None:
print(f'{self.name} says "Hello"')
else:
print (f'{self.name} says "{text}"')
def answers (self, answer=True):
if self.name == "Grok":
print(f"{self.name} answers: yes... and yes... and actually also no... but wait, let me explain in 17 paragraphs with 4 code blocks and a 600-word tangent about what else you can do with Python arguments...")
else:
print(f'{self.name} says "{"No" if not answer else "Yes"}"')
person1 = Person("Grok")
person2 = Person ("User")
#print (person1.name)
person2.talk()
person1.talk()
person1.answers()
person2.talk("Thanks!")
bl