带参数

类 / 构造函数

class Man:
    def __init__(self, name):
        self.name = name


man = Man("Alex")
# man.name is 'Alex'

print(f"{man.name = }")