用小时蟒蛇3.6打印学生成绩

时间:2017-08-15 20:57:06

标签: python-3.x

在我的程序中,如果我改变

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",[],[])

1 个答案:

答案 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)