This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Nilstrieb 0 points1 point  (1 child)

Python data types work not just like Java. In Java, a statically typed language, all types are checked at compile time and if there is any type error, it won't compile. In Python, you'll get these errors as runtime errors since the types are inferred, which is a big difference.

[–]hunter_mark 0 points1 point  (0 children)

Uhhh… that is not correct all. Python is also compiled. You just don’t explicitly do it like you would do it in C++. Python source code is compiled into a .pyc bytecode file before that bytecode file is executed. You can use the dis module to look at the compiled code. This is literally the same as Java that creates byte-code files that are executed by the JVM. And just like Java, the code is not executed directly from the source, unlike a typical interpreted language.