What is the difference between functions and methods in python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What is the difference between functions and methods in python?

https://code.sololearn.com/cscy4Vhx5dl5/?ref=app

4th Aug 2018, 7:23 PM
Kalyan
Kalyan - avatar
7 Answers
+ 4
Hello body! In fact both of them are function. But the functions which are in the Class (Object) named method.
4th Aug 2018, 7:35 PM
xXx
xXx - avatar
+ 2
Well it could be, if you check out other programing languages you can find languages which Print function is a method of some class.
4th Aug 2018, 7:49 PM
xXx
xXx - avatar
+ 2
SHATRUGHAN Check out this code to understand better 😴https://code.sololearn.com/cscy4Vhx5dl5/?ref=app
4th Aug 2018, 9:24 PM
Kalyan
Kalyan - avatar
+ 1
Its just terminology between programs. In C/C++ we call them function. For python, they are method
4th Aug 2018, 9:05 PM
SHS
SHS - avatar
0
why print function not kept in some class??
4th Aug 2018, 7:37 PM
Kalyan
Kalyan - avatar
0
method is the name/terminology to be used in context of OOP. Function is the name/terminology to be used outside of OOP context. Ideally, both perform the same execution albeit the difference in context.
4th Aug 2018, 11:29 PM
Deepak Pandit
Deepak Pandit - avatar
0
method is something belongs to object
5th Aug 2018, 5:56 AM
nurettin asd
nurettin asd - avatar