[oop] 用 __init__ 给对象传参 题目反馈

未关闭
#310 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
活跃
技术栈
python

调研方向

Start by reproducing the exercise described as “用 init 给对象传参” with the submitted Person example and inspect how the checker and “View Answer” respond. Done means the exercise correctly accepts the intended solution or clearly identifies the actual mismatch to the learner.

由索引模型根据 Issue 内容生成。

描述

题目 用 init 给对象传参(基础语法的第八章:面对对象的第二题)

我是一名之前没接触过编程的纯新人,在尝试使用您制作的网页学习python时于上题时反复调整print处的空格位置和使用ai工具,但还是无法通过检测过关,在使用“查看答案”还是无法找到问题所在,不清楚是什么情况,特此求解

I'm a complete beginner with no prior programming experience. While trying to learn Python using the webpage you created, I got stuck on the previous question. I repeatedly adjusted the spacing in the  print  statement and even used AI tools, but I still couldn't pass the test. Even after clicking "View Answer," I couldn't figure out what the issue was. I'm not sure what's going on, so I'm reaching out for help.

这是我打出的代码:
class Person:
def init(self, name, age):
self.name = name
self.age = age

def greet(self):
    print(f'我叫 {self.name},今年 {self.age} 岁')

p = Person('张三', 18)
p.greet()

主要语言
Python
星标
28.1k
派生
5.6k
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

walter201230/Python 的其他 Issue

查看 walter201230/Python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。