Python Operator Exercises

Let’s check out some exercises that will help understand Python Operators better.

Exercise 18-a: Assignment Operator =

Let's start with the most basic . Assign a list of colors to the variable: ["yellow", "white", "blue"]


Assignment operator is:

=

Assignee (variable) goes to the left of the = sign and value(s) being assigned goes to the right of the = sign.

lst = ["yellow", "white", "blue"]

Exercise 18-b: Division Operator /

Assign division of a to b to the variable.


Division operator which is an arithmetic operator is: /
result=a/b