+ 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()

27th Aug 2022, 1:15 PM
Undercover Agent
Undercover Agent - avatar
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()
29th Aug 2022, 8:06 AM
Jayakrishna 🇼🇳
+ 1
Thanks
29th Aug 2022, 9:49 AM
Undercover Agent
Undercover Agent - avatar