Updating variables

Question number 74

I did not under stand.

If we try to update a variable that is not yet assigned any value i.e. it doesn’t exist, you get an error, because Python evaluates the right side before it assigns a value to a.

Therefore, before updating, we need to initialize the variable.

:“Yet not assigned any value”

Which value are you talking??

We are talking about cases where we are updating a variable with a value calculated using the variable itself.

See the examples in the slide.

For example, here:

X = 4*X + 5

it is written "Value goes right to left in order Python evaluates the right side before it assigns a value to a"

What does this statement mean??

x =4* x + 5

will the python check num ‘5’ on the right side and then it goes to next variable “x”??

if the value is 5 then it goes further, right??

Please clarify.

Please run some tests by yourself to clear doubts. The Python interpreter can better answer your such doubts.