+ 1

why there is method and function in python. what a difference from both of them. I do not understand.

2nd Sep 2017, 1:24 AM
Zeron
Zeron - avatar
8 odpowiedzi
+ 4
methods belong to classes, functions live out in the open.
2nd Sep 2017, 1:27 AM
ChaoticDawg
ChaoticDawg - avatar
+ 2
They're are basically the same thing but when you hear someone reference a method, you know that it directly relates to an object or a class, where as a function is just a function somewhere in the code but not directly related to an object or class.
2nd Sep 2017, 1:30 AM
Dustin Hammack
Dustin Hammack - avatar
+ 1
and thank you for the others. 😶
2nd Sep 2017, 1:35 AM
Zeron
Zeron - avatar
+ 1
a function is a statement that relates an input to just one output a method is the process to get that output
2nd Sep 2017, 1:42 AM
Naomi
Naomi - avatar
0
@Michelle wow you always know what some people do not know. thanks for your answer.
2nd Sep 2017, 1:30 AM
Zeron
Zeron - avatar