+ 1
What's wrong with this code??
Class Student: mark1,mark2,mark3 = 45,50,55 def solv(self): sum = Student.mark1 + Student.mark2 + Student.mark3 avg = sum/3 print("your marks = " , sum) print("your avgerage =" , avg) return s = Student () S.solv()
2 Answers
+ 1
#Compare with this corrected code :
# autocapitalization, identation mistakes
class Student:
mark1,mark2,mark3 = 45,50,55
def solv(self):
sum = Student.mark1 + Student.mark2 + Student.mark3
avg = sum/3
print("your marks = " , sum)
print("your avgerage =" , avg)
s = Student ()
s.solv()
+ 1
Thanks