# 6.1. Operators

## 6.1.1. Operator precedence

Table 10. Operator precedence

Operator

Description

lambda

Lambda expression

if, elif, else

Conditional expression

and

Boolean AND

or

Boolean OR

not x

Boolean NOT

in, not in, is, is not,

<, <=, >, >=, !=, ==

Comparisons, including membership tests and identity tests

|

Bitwise OR

^

Bitwise XOR

&

Bitwise AND

<<, >>

Shifts

**

Exponentiation

*, @, /, //, %

Multiplication, matrix multiplication, division, floor division, remainder

+, -

+x, -x, ~x

Positive, negative, bitwise NOT

await

Await expression

x[index], x[index:index],

x(arguments...), x.attribute

Subscription, slicing, call, attribute reference

(expressions...), [expressions...],

{key: value...}, {expressions...}

Binding or tuple display, list display, dictionary display, set display

## 6.1.2. Assignments

### 6.1.2.1. Is even number

• Complexity level: easy

• Lines of code to write: 5 lines

• Estimated time of completion: 5 min

English
1. Read a number from user

2. User will pass only valid int

3. Number is even, when divided modulo (%) by 2 reminder equal to 0

4. Print whether number is odd

5. Do not use if statement

Polish
1. Wczytaj liczbę od użytkownika

2. Użytkownika poda tylko poprawne int

3. Liczba jest parzysta, gdy dzielona modulo (%) przez 2 ma resztę równą 0

4. Wypisz czy liczba jest nieparzysta

5. Nie używaj instrukcji if

The whys and wherefores
• % has different meaning for int and str