Why don't the functions dir(), locals(), globals() in PyCharm?

Hello!
Wrote in a script the following code:
dir()
locals()
globals()

But nothing he brought to the screen, tell me, please, what's the problem?
March 19th 20 at 08:41
2 answers
March 19th 20 at 08:43
Solution
Because none of these functions does not output.
Why if they write directly in the interpreter, the output is? - afton_Ebe commented on March 19th 20 at 08:46
@afton_Ebebecause they can write
> a = 1
> a
Will 1.
In real life you need to write print(a)
This is the harsh reality - Jonatan_Schuppe commented on March 19th 20 at 08:49
@afton_Ebe, there, to the fiction, you can add any book on Python, almost everywhere is described as running an interactive python console - Jonatan_Schuppe commented on March 19th 20 at 08:52
@afton_Ebebecause it is a REPL. - Renee39 commented on March 19th 20 at 08:55
March 19th 20 at 08:45
Solution
print(dir())
print(locals())
print(globals())
Refer to the documentation or just try to withdraw if you are not sure what the function of something should take and not just return)

Find more questions by tags Python