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

Aperta
#310 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
28.1k
Fork
5.6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di walter201230/Python

Tutte le issue di walter201230/Python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.