所以我有一个代码,我想先解决这个问题
class Lecturer (Person):
def lecture (self, stuff):
self.say(stuff + "- you should be taking notes")
然后我试着做一个名为professor的课,在这个讲座上,我做了这样的代码
^{pr2}$然而,问题来了,我需要把讲义的定义带进来,这样def profess就会调用它,这意味着它在结尾添加了profess的第一部分。在
ex.X声称“凭直觉很明显……无论你想说什么,你都应该记笔记。”
我只是不知道怎么让它叫它,你需要把讲师说(self,stuff)或者诸如此类的东西,这是我自己学习python的一部分,但是如果我继续自己的工作,任何帮助都会很感激的。在
那么教授要么“当”讲师,要么“有”讲师。在
结果
^{pr2}$看起来你想要的是创建一个子类。在
既然这是家庭作业,我就让你来决定用什么来代替
pass
。在相关问题 更多 >
编程相关推荐