ii moodle.cs.colorado.edu Practice Exam English (United States) (en us) Programm
ID: 3573346 • Letter: I
Question
ii moodle.cs.colorado.edu Practice Exam English (United States) (en us) Programming (Novice) e Problems Help Session 2 Create a class named Student that has public data members name (string) and scores aist of integer values). Provide a constructor that takes a parameter for initializing the name and initializes the list to an empty list. Provide a public method Addrvalue) to add new items to the end of the list. Also provide a public method Mean0 that returns integer average of values in list or if there are no values in the list, return None. Answer: class Student 2- def init. Cself,name self name name self scores 5 def Add(self,value): (self scores append(value) 7- def Mean self) self ave 0 if((self scores)--0): return None else: for score in self.scores: if score self.lowest: 13 self lowest-score 14 return self lowestExplanation / Answer
o/p
None
48
Can't give the output of the code because of parsing error by Chegg.
I think first one has already been written. So I have wrote the code for other 3. Please ask me if you have any doubt.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.