第30060题 单选题
以下关于Python类与对象的代码运行结果和说法,正确的是?

给定如下Python代码:

class Person:
    def __init__(self, name):
        self.name = name
    def greet(self):
        return f'Hello, I\'m {self.name}'

p1 = Person('张三')
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析