I don't understand in place operators the first part | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

I don't understand in place operators the first part

DAT boii

14th Aug 2017, 7:51 PM
Keanu Big Eagle
2 ответов
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.
28th Apr 2018, 10:01 PM
Seb TheS
Seb TheS - avatar
0
👍
3rd May 2018, 5:31 AM
Karl Gustavich
Karl Gustavich - avatar