0

Why I need to put def my_func to start a code and to end with ?

def my_func(): print("spam") print("spam") print("spam") my_func()

16th May 2018, 4:35 PM
Tanzim Ikram Sheikh
Tanzim Ikram Sheikh - avatar
4 Réponses
0
At first you’ve defined, then you called it
16th May 2018, 5:19 PM
Eterxoz
Eterxoz - avatar
0
but why I need to call it ? we have not call before while working with other functions
16th May 2018, 5:21 PM
Tanzim Ikram Sheikh
Tanzim Ikram Sheikh - avatar
0
It’s not necessary to call it. If you need the functionality of your function then you call it.
16th May 2018, 5:28 PM
Eterxoz
Eterxoz - avatar
0
got it. Btw thanks a lot 😊Eterxoz
17th May 2018, 1:15 PM
Tanzim Ikram Sheikh
Tanzim Ikram Sheikh - avatar