下面是代码
class Allquestion:
def __init__(self,question):
self.question=question
def show_question(self):
print(self.question)
my_new_question=Allquestion("english")
print(my_new_question.show_question())
输出结果
下面是代码
class Allquestion:
def __init__(self,question):
self.question=question
def show_question(self):
print(self.question)
my_new_question=Allquestion("english")
print(my_new_question.show_question())
输出结果
第一个是show_question 打印的english
第二个是print(my_new_question.show_question()) 由于你没有返回值,所以是none