Ask Your Question
2

How is Python code different from C++ code so that it doesn't work in the same way?

asked 2023-05-24 15:28:47 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-24 15:46:01 +0000

devzero gravatar image

Python code is interpreted while C++ code is compiled. This means that Python code is read, translated and executed line-by-line in real-time, while C++ code must be compiled into machine code before it can be run. This makes Python code easier to write and debug, but also slower and less efficient than C++ code. Additionally, Python is dynamically typed, while C++ is statically typed, which means that variable types in Python are determined at runtime while variable types in C++ must be declared at compile-time. Finally, Python code is usually shorter and more concise than C++ code, partly due to its use of a higher-level language and built-in functions.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-24 15:28:47 +0000

Seen: 8 times

Last updated: May 24 '23