Hello friends!!!!!
Problem of the day
PYTHON
11/7/20241 min read
class student:
def init(self, name, marks):
self.name = name
self.marks = marks
def avg(self):
Sum = sum(self.marks)
a = len(self.marks)
average = Sum / a
print(f"{average} is Average-mark scored by {self.name}")
s = student("Rishendra", [21, 23, 25, 19, 23, 26])
print(f"{s.name} is the name of a Student.")
s.avg()
Output:
Rishendra is the name of a Student.
22.833333333333332 is Average-mark scored by Rishendra
=== Code Execution Successful ===