from Student import Student
student1 = Student("Oscar", "Accounting", 3.1)
student2 = Student("Phyllis", "Business", 3.8)
print(student1.on_honor_roll())
class Student:
def __init__(self, name, major, gpa):
self.name = name
self.major = major
self.gpa = gpa
def on_honor_roll(self):
if self.gpa >= 3.5:
return True
else:
return False
这是我的代码,下面是我关注的视频链接。请尝试帮助我,因为这是如此令人沮丧,因为我被困在这几个星期:(!!!!!!!)
输出:
您所犯的错误:
def on_honor_roll(self):
应该直接到def __init__(self, name, major, gpa):
我的意思是它们应该具有相同的缩进级别相关问题 更多 >
编程相关推荐