shorthand assignments operators, how do they work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

shorthand assignments operators, how do they work?

Can someone help explain how shorthand assignment operators

23rd May 2017, 6:23 PM
Emmanuel James
Emmanuel James - avatar
2 Answers
+ 7
x += y # x=x+y x -= y # x=x-y x *= y # x=x*y x /= y # x=x/y x %= y # x=x%y x **= y # x=x**y It's quite nicely covered in the Ruby tutorial
23rd May 2017, 6:26 PM
Pixie
Pixie - avatar
0
@pixie is x**y =x*x*y or x* (*y) where (*y) is a pointer?
24th May 2017, 6:27 AM
U L Knw Me soon๐Ÿ˜‰๐Ÿ˜‹
U L Knw Me soon๐Ÿ˜‰๐Ÿ˜‹ - avatar