We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
classStudent(Person):# Class Constructordef__init__(self,firstName,lastName,idNum,scores):self.firstName=firstNameself.lastName=lastNameself.idNumber=idNumself.scores=scores#defcalculate(self):avg=sum(self.scores)/len(self.scores)if((90<=avg)and(avg<=100)):returnstr("O")elif((80<=avg)and(avg<90)):returnstr("E")elif((70<=avg)and(avg<80)):returnstr("A")elif((55<=avg)and(avg<70)):returnstr("P")elif((40<=avg)and(avg<55)):returnstr("D")else:returnstr("T")
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Inheritance
You are viewing a single comment's thread. Return to all comments →