How-to articles, tricks, and solutions about PYTHON-3.X

Using Python 3 in virtualenv

Here is an example of how you can use Python 3 in a virtual environment using the virtualenv package:

What does -> mean in Python function definitions?

In Python, the "->" symbol is used to indicate the return type of a function.

What does "SyntaxError: Missing parentheses in call to 'print'" mean in Python?

The "SyntaxError: Missing parentheses in call to 'print'" error message is raised when you are using Python 3 and you have forgotten to include the parentheses when calling the print() function.

What is __pycache__?

__pycache__ is a directory that is created by the Python interpreter when it imports a module.

What is the naming convention in Python for variable and function?

In Python, variable and function names should be lowercase, with words separated by underscores.

Why is "1000000000000000 in range(1000000000000001)" so fast in Python 3?

The range() function generates a sequence of numbers, starting from the first argument, and ending before the second argument.

1 2