What is the difference between normal function calling and with self keyword function calling | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

What is the difference between normal function calling and with self keyword function calling

26th Nov 2021, 11:27 AM
Naveen K
3 Respostas
+ 3
Here is an example. Do you see the difference. There are two times a function "show_color(). One inside the object and one outside. And from inside the object both are called. https://code.sololearn.com/cKq7dvCc3s4T/?ref=app
26th Nov 2021, 11:56 AM
Coding Cat
Coding Cat - avatar
+ 2
Please tag the relevant programming language! Do you mean Python? A function with self as parameter is a method ā€“ it is a function of a class.
26th Nov 2021, 11:46 AM
Lisa
Lisa - avatar
0
Thank you I got my answeršŸ‘šŸ‘šŸ‘
26th Nov 2021, 12:03 PM
Naveen K