User Tools

Site Tools


python3

1. Python Language Reference

Programming languages are a tool. While many modern programming languages are designed to be general purpose, some programming languages may be better suited to solve certain problems than others.

When to use Python3

While efficiency of a program is key to solving many contest problems, efficiency of the programmer is also critically important. Python3 is known for its expressive nature: problems that are solvable in Python3 are often solvable in far fewer lines than would be required in C++ or Java1). Some of the easiest real-world contest problems can be solved in fewer than 5 or 10 lines of Python3 code. A firm grasp of Python3 may make the difference in solving easy and medium level problems, and doing so faster than other competitors.

When not to use Python3

The reverse is also true. Python3 may be the wrong choice for other problems. While Python3 boosts programmer efficiency, it inherently lacks runtime efficiency. Python3 cannot compete with well written C/C++/Java code. Certain contest problems may not be solved within prescribed time bounds using Python3.

Fortunately, while a wrong choice of Python3 can be a (potentially major) setback in an actual competition, Python3 code follows many common pseudocode conventions and can be quickly converted to C++ or Java code. Such converted code is likely to perform significantly before it is optimized.

Python3 is a natural choice for many of the problems that are selected for the first half of a programming contest.

Input/Output

  • Input for Programming Contests
  • Output for Programming Contests

Data Structures

Sequential Structures

Sequential Structures: Operators and Functionality

Non-Sequential Structures

Functional Programming

Recursion

Higher Order Functions

Memoization

Generators

Mathematical Types and Operations

Numeric Types

1)
At the time of the initial version of this guidebook, Java is not currently supported by the guidebook authors.
python3.txt · Last modified: 2019/05/07 14:52 by jguerin