在我的程序中,如果我改变
Uncaught TypeError: Cannot read property 'showSnackbar' of undefined
at test
到
stud1 = Student("John","Brown",["A","B","A"],["15.0","25.0","20.0"])
打印出为学生选择的成绩及其花费的时间是一个好方法。 现在“print(stud1.getGrade())”的输出是('A','15 .0')。
代码:
stud1 = Student("John","Brown",[],[])
答案 0 :(得分:1)
def getGrade(self):
for a,b in zip(self.grade, self.hours):
return (a,b)
应该是
def getGrade(self):
return zip(self.grade, self.hours)