>>> from platform import system, release
>>> print(system, release)
<function system at 0x00000126E1EC9280> <function release at 0x00000126E1EC93A0>
>>> print(system(), release())
Windows 10
I'm bringing up the information on the current system What is the exact reason for the difference in output depending on the function followed by () and not?
python python-3.x
Python is a first-class object language.
def func(): return 1
When
func()
is a function call, but func
is a pointer to the function. The address of the function.
def process(f):
return f()
def func(): return 1
print(process(func))
The above code outputs 1.
We put func as a process function and run it.
© 2024 OneMinuteCode. All rights reserved.