I don\'t understand how classes are used. The following code gives me an error when I try to use the class.
class MyStuff:
def average(a, b, c): # Get th
Try this:
class mystuff:
def average(_,a,b,c): #get the average of three numbers
result=a+b+c
result=result/3
return result
#now use the function average from the mystuff class
print mystuff.average(9,18,27)
or this:
class mystuff:
def average(self,a,b,c): #get the average of three numbers
result=a+b+c
result=result/3
return result
#now use the function average from the mystuff class
print mystuff.average(9,18,27)