Question: QUESTION 3 Consider the following class which is an ahstraction of a Student. There are a few questions ( Questions 2 , 3 and 4
QUESTION
Consider the following class which is an ahstraction of a Student. There are a few questions Questions and that will wese this class.
Use this code in select the statement below that best describes why there is an error in Method
class student:
def Initself nare, Ib:
self, nate nane
self. TD
self,testscores
def rethad self score:
self,testscores, appendscore
def nethodself:
f lenselttestscores :
return suxselftestscoreslentelftestscares
else:
return
trTHIS METHoo has AN ERHOW
def rethadself :
scarn anthad
If score :
return
elif score ge:
return
elif score :
return
elsf score :
return
return
def rethod self:
return self.nane
def rethod sself:
return self.ID
WTHIS METHOO HAS AN ERHOR
def strself:
print Studont with ID has current scores: self. testscores
mofnod noods an additionsl argement that is the list of scores
The calculationg in mefrod ans incomect.
The mothod call to mothod is inoormact.
mofhod has mone then roturn statement which is not allownd
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
