This should be the proper method of calling a function inside another function:
def function1():
print("Hello!")
def function2():
function1()
function2()
Here it should give a None because I didn't return any value. Why None is not present in the output?
Hello!
I've tried this:
print(function2())
When I'm calling the function inside a print() function, why is it giving me the result with None?
Hello!
None
But when I do like this, why is it giving me the same result?
def function1():
print("Hello!")
function2 = function1
function2()
Here I've just assigned function1 to function2. I didn't make any function2(). But when I'm calling function2(), why is it giving a result from function1()?
Hello!