1 of 12

HackNUthon

Team Name: Eagles

2 of 12

Team Members:�21BCE143: Manav Pandya�21BCE164: Jiya Nayak�21BCE212: Ojasvi Patel�21BCE295: Darshak Talaviya

2nd Semester CSE Department

3 of 12

Why Python is better than C++

  • Python has fewer lines of code and Python supports garbage collection but C++ doesn’t support garbage collection but it can be implemented.
  • Python uses short-hand syntax and has numerous short hand structural iterators.
  • Easy projects setup, live interpreter and rapid prototyping is possible.

4 of 12

Convert Python code to C++ code

5 of 12

What is Competitive Programming ?

  • Competitive programming is a mind sport usually held over the Internet or a local network, involving participants trying to program according to provided specifications. Contestants are referred to as sport programmers.
  • We can do competitive programming in many languages.
  • We can use C++,C ,Python ,Java ,Ruby ,Kotlin and many others.
  • The aim of competitive programming is to write source code of computer programs which are able to solve given problems.
  • The simple meaning of competitive programming is that which data structure is suitable for what type of problem to get the optimize solution.

6 of 12

  • In coding, Python is comparatively easy than other language. Writing code in Python is easy but everyone knows that it is slow, so in contests many times we get “TIME LIMIT EXCEEDED” error. So in many problems we can not use Python.

  • So C++ is very preferable for competitive programming because it compiles the code very fast than any other programming language so we can solve this “TIME LIMIT EXCEEDED” error.

7 of 12

Why C++ ?

  • C++ is considered to be the best choice for competitive programming by 75% of the programmers across the world, as it is usually faster than Java and Python and most of the resources are available in C++.

  • C++ has a vast library called STL(Standard Template Library) which is a collection of C++ templates to provide common programming data structures and functions such as lists, stacks, arrays, etc. That makes the code very short and increases the speed of coding.

8 of 12

Why Python is not ?

  • Python is extremely slow compared to C++.That is the reason it is not popular in competitive programming.

  • Python is slow because it is an interpretive language. So in competitions, it will never win a speed contest or a competition.

  • Python is up to about 400 times slower than C++ and with the exception of a single case so it has this limitation of speed.

9 of 12

10 of 12

11 of 12

We have made a small program that will take input in Python and will give us output as C++ code.

Similarly, after doing some research, we will try to make a full fledged program which will convert any Python Code into C++code.

12 of 12

Thank you