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

Aberta
#310 2 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Precisa de esclarecimento
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
content, testing-qa

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

题目 用 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()

Linguagem predominante
Python
Estrelas
28.1k
Forks
5.6k
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de walter201230/Python

Todas as issues de walter201230/Python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.