0
Whats the difference?
Whats the difference between method and function in python? Please expain in a simplified way I am a newbie learnerđđ
4 Answers
+ 6
A method is a function within a class.
Other than that, they are the same
class Dog:
def make_noise(self):
print('bark!')
Dog.make_noise()
bark!
OR
def make_noise():
print('bark!')
make_noise()
bark!
0
I'd say a method can be either a function or a procedure.
A function returns data, whereas a procedure doesn't.
0
For slick
Whats a class
0
Whats this?