In [1]:
def greet(name):
return f"Hello, {name}!"
print(greet("Paul"))
Hello, Paul!
In [2]:
class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def greet(self):
msg = f"Hello, {self.name} ** {self.age}"
return msg
person = Person("Paul", 25)
print(person.greet())
Hello, Paul ** 25