Question: Use this code to select the statement below that best describes why there is an error in the str method. class Student: def ( self
Use this code to select the statement below that best describes why there is an error in the
str
method.
class Student:
def self name, ID:
self.name name
self.ID ID
self.testscores
def methodself score:
self.testscores.appendscore
def methodself:
if lenselftestscores :
return sumselftestscoreslenselftestscores
else:
return
#THIS METHOD HAS AN ERROR
def methodself:
score nethod
if score :
return A
elif score :
return
elif score :
return
elif score :
return
return
def methodself:
return self.name
def methodself:
return self.ID
#THIS METHOD HAS AN ERROR
def self:
print student with ID ID has current scores: self, test scores
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
