New course! Every coder should learn Generative AI!
Try a free lesson+ 1
The Python interpreter operates somewhat like the Unix shell: when called with standard input connected to a tty device, it reads and executes commands interactively; when called with a file name argument or with a file as standard input, it reads and executes a script from that file.
Unlike C or C++ which are compiled and then run, Python is an interpreted language. By default, Python source files are treated as encoded in UTF-8. In that encoding, characters of most languages in the world can be used simultaneously in string literals, identifiers, and comments.
All because python is not a strongly typed language.
Check this out for more details
https://docs.python.org/3/tutorial/interpreter.html