第11208题 单选题
找出下列Python代码主程序中会导致运行错误的行

<pre><code class="language-python">class Pet: def init(self, n, a): self._name = n self._age = a def get_name(self): return self._name def birthday(self): self._age += 1 if name == "main": cat = Pet("奶茶", 2) print(cat.get_name()) # ① cat.birthday() # ② cat._name = "大橘" # ③ print(cat.get_name()) # ④</code></pre>

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