0
Why do we need this last function(£
here is the code def function(): print(“this is fun”) function() I do not understand why do we need to call function() at the end in order to print ?
3 ответов
+ 3
Without calling a function how do you expect it to do something?
Edit: If you need a pen then you have to ask for it to someone, without you asking how would someone give you a pen not knowing that you don't have one.
+ 3
a function is like a cow that eats grass(the input) which its body turns into milk which a farmer(function() function call) then milks(the ouput)
def function():
print("this is fun")
the above two lines only define what will the work of the function be(so no action done) and the below line calls the function(now this will do some action)
function()