Python vs C++
Difference between Python and C++
Python and C++ programming languages are two most used programming languages used by programmers in competitive programing. C++ was released in 1985 by Bjarne Stroustrup as an extension to c programing language. Lets us have a look at the difference between python and C++ programing language. “Python vs C++”
Difference between Python and C++
Attributes | Python Programing | C++ Programing |
---|---|---|
About | Python is the general-purpose interpreted programing language It is interactive, object-oriented and high level programing language | C++ is a general-purpose programing language. It is an extension of C and C++ is also considered as C with class |
Efficiency | As python is interpreted language hence it is slower than compiled languages | C++ is faster than python as it is Compiled language |
Syntax | Python syntaxes are simpler and easier to remember | C++ Syntaxes are harder as compared with python programming |
Variable declaration | No need to declare the type of the variable while initializing it will automatically be declared on program execution | We need to declare the type of the variable while we initialize a variable in C++ programing |
Library functions | Python programming have a wast library of functions as compared to any programing language | When compared with python, the library of C++ language is not much wast |
Nature | Python is dynamically typed | C++ is statically typed |
Applications | Web development, Machine learning, Artificial Intelligence, etc | Operating System, Games, GUI, Banking applications, etc |
Python Programming Language
Python Programing Language was introduced by Guido van Rossum in 1989 and the first version 0.9.0 of the language was introduced in 1991. Till then we have total 25 updates for python and now 3.8 is the most stable version used by the developers in the programming field. Python programing has now become more popular due to its rich library support and easy syntax. Python is used in many areas of development, Web development, Machine learning, Artificial Intelligence are some most popular areas of work. Some more application where python is used are:
- Data Science
- GUI
- Game Development
- Web Scraping
- 3-D Graphics
etc.
Code in Python Programming Language for checking divisibility by 3
number = int(input('Enter the Number :')) if number % 3 == 0: print('Yes') else: print('No')
C++ Programming Language
C++ Programing Language was introduced in 1985 by Bjarne Stroustrup as an extension to C programing language. C++ has a major update after C, it was an object-oriented language and was more efficient than C programing language. It gave programmers a high level of control over system resources and memory. C++ programing language got major updates 3 times in 2011, 2014, 2017 with C++11, C++14, and C++17. C++17 is the updated and the stable version of the language available for the programmers to use. Some applications of C++ programing language are:
- Graphics designing
- Distributed System
- Data-Base
- Telephone-Switches
- Compilers
etc
Code in C++ Programming Language for checking divisibility by 3
#include<bits/stdc++.h> using namespace std; int check(string number) { int num = number.length(); int Sum = 0; for (int i=0; i<num; i++) Sum += (number[i]-'0'); return (Sum % 3 == 0); } int main() { string number = "1331"; check(number)? cout << "Yes" : cout << "No"; return 0; }
Prime Course Trailer
Related Banners
Get PrepInsta Prime & get Access to all 200+ courses offered by PrepInsta in One Subscription
Get over 200+ course One Subscription
Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others
Login/Signup to comment