0
I don't understand in place operators the first part
DAT boii
2 Antworten
0
Ok, It was hard for me too to understand, but it isn't much different to assigning a variable:
In-place operators re-assigns a variable by this logic:
X += 1 is same than X = X + 1
X -= 2 is same than X = X - 2
X *= 3 is same than X = X * 3
X %= 4 is same than X = X % 4
so X += 5 is just a shortcut for X = X + 5.
example:
Y = 4
Y *= 2
print(Y)
>>>>>>>>>>
result: 8
>>>>>>>>>>
Now I suggest you to study the module through again and try it out on the Python3 playground.
0
👍