Tahir Usman due to the evaluation order
It must evaluate the innermost execution before moving on to the next one
Take this code for instace
return x + 1
return x * 2
As you can see, the "bar" function takes the return value of "foo" so it has to be evaluated first
"foo" takes the value 20 and return 21 which is then passed to the "bar" function which in turn returns 42 which is outputted by "print"
inner most print, prints "Hello" and returns None. Then the argument to next print is None, so it prints None and returns None and it carrries on, Try this
x = print("Hello")
print(x) // prints None
Any function in python that does not explicitly returns a value, implicitly return None.
The print function does not have a return value
So going thru the evaluation order the inner most print call print("Hello") is executed and outputs "Hello"
Each other print call will output the value which retuned from the call of print which is None
you can test yourself to see what a function with no return value prints
x = 42 # doesn't matter what the function does, as long as it doesn't return anything
"print( )" is actually a function, and it prints the statements inside the paratheneses, known as arguments.
The innermost print prints "Hello". But the next print does not have any string argument, and the value is absent. Absence of a value in python 3 is declared by "None".
As the other prints don't have string arguments, they print None.