What is the biggest difference between Python and C++? Any advantages of either over the other? Which is better for which fields | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the biggest difference between Python and C++? Any advantages of either over the other? Which is better for which fields

Python or C++

31st Mar 2021, 1:42 AM
GRACe
GRACe - avatar
21 Answers
+ 18
The biggest difference between Python & C++ is that Python is interpreted & dynamically typed (types of variables can change) while C++ is compiled & statically typed (types of variables cannot change). This leads to many differences like: 1. Python can be much much slower and heavier in terms of memory. For example, an instance of an empty class in Python occupies 48 bytes of space while in C++ it occupies only 1 byte 2. Python is harder to debug because of being interpreted. A very basic example is that if you wanted to return int("100") from a function but returned "100", there would be no error but it will cause problems later. C++ being compiled, can perform a lot of checks and optimizations before even running the program. 3. Python is easier to learn and write 4. Python has tons of libraries and a built-in package manager Python is used more in fields like data science where performance is not the highest priority and C++ is used in the exact opposite fields like game development.
31st Mar 2021, 9:46 AM
XXX
XXX - avatar
+ 5
Ebuka Anafulu The biggest difference between Python & C++ is that Python is interpreted & dynamically typed (types of variables can change) while C++ is compiled & statically typed (types of variables cannot change). ... Python can be much much slower and heavier in terms of memory
1st Apr 2021, 9:10 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 4
I think both has théir own importance
31st Mar 2021, 6:22 PM
Yawar Abbas
Yawar Abbas - avatar
+ 3
The amount of work given to the programmer. C++ needs more planification (for more specifics results if you want), and python doesn't. This make python easy to learn on some cases.
31st Mar 2021, 1:51 AM
MICAEL MIRANDA
MICAEL MIRANDA - avatar
+ 3
Python is the preferred and chosen language in Data Science.
31st Mar 2021, 4:32 AM
Jan
Jan - avatar
+ 3
the big difference is that c++ is more widely used in all categories. I chose the c++ path myself.
1st Apr 2021, 6:45 AM
Alex
Alex - avatar
+ 2
Jan Markus yeah so?
31st Mar 2021, 3:11 AM
GRACe
GRACe - avatar
+ 2
BeegCat so you're saying Python is easier to use but C++ is more efficient?
31st Mar 2021, 3:12 AM
GRACe
GRACe - avatar
+ 2
Jan Markus I get that but what's your point?
31st Mar 2021, 3:18 AM
GRACe
GRACe - avatar
+ 2
In c we have limited library and in python we have a lot of library
31st Mar 2021, 4:25 AM
Pratigya Patidar
Pratigya Patidar - avatar
+ 2
hi too all. C++ is best programming for pc game like Minecraft clash of clans pubg and etc but Python is very important in IOS or Android
17th Jul 2021, 6:58 AM
ALIREZA
ALIREZA - avatar
+ 1
I see...but what can Python do that C++ can't...or the reverse?
31st Mar 2021, 2:02 AM
GRACe
GRACe - avatar
+ 1
Grzegorz Słowiński True.. thats why my python friends semicolons are useful.. you wont get an error because of a tab :)
31st Mar 2021, 8:55 PM
Γεωργιος Τανανης
Γεωργιος Τανανης - avatar
+ 1
C++ is efficient and very fast while Python is easier but very slow. Better use both of them
1st Apr 2021, 10:09 AM
Sadam Ibrogimjonov
Sadam Ibrogimjonov - avatar
+ 1
The main reason I prefer C (and C++) over python is because it's way faster than python, and does the job without using much memory. It's also very much structured, a fair enough excuse for liking it. Finally, you don't want your device to keep on interpreting a long code, if it's never changed (as in the case of many single-purpose devices); the machine code generated by C (and C++) is faster to execute.
1st Apr 2021, 10:57 AM
Calvin Thomas
Calvin Thomas - avatar
+ 1
Ebuka Anafulu c++ and python can do anything in a simple way. But python does things more eficient on some cases, but if you want to go out of the python usual circusntances, is better use c or c++. Sorry for bad english.
1st Apr 2021, 12:36 PM
MICAEL MIRANDA
MICAEL MIRANDA - avatar
+ 1
Differences - compiler issues, memory hogging, user-friendly coding & latency. Which is advantageous ? Do you want to start a war in the comment section ? Fields : C++ for gaming & graphic intensive tasks. Python for Analytics & Automation.
1st Apr 2021, 4:59 PM
SPA Iyer
+ 1
Hi Ebuka Anafulu. the basic things is c++ is more recommend for creat games and app for computer or mobile for android. but Python is used for IOS development to use to make app. I learned C++ for make game or app.
1st Apr 2021, 5:19 PM
ALIREZA
ALIREZA - avatar
+ 1
Python: print("text") C++: count << "text"
16th Jul 2021, 7:12 PM
CGO!
CGO! - avatar
+ 1
ALIREZA In Python too to create video game
17th Jul 2021, 1:04 PM
CGO!
CGO! - avatar