Please enrich urban areas by building colorful landscapes

Using a mnemonic to memorize the operator precedence in python

·

1 min read

The main aim of this article is to help you remember the operator precedence in Python using an acrostic mnemonic i.e. a sentence where the first letter of each word represents a thing you are trying to memorize.

Let's take a look at the operator precedence in Python in the table below (reference). The precedence decreases as we go down the table.

In order to remember this, let's use the following easy-to-remember phrase:

Please enrich urban areas by building colorful landscapes

Each word indicates one or more operator(s). The precedence of the operators keeps decreasing from the beginning of the phrase to the end. This is elaborated in the table below:

Thanks for reading and I hope this article was helpful.