Do you have any cool examples? I’m actually pretty excited to see how the community uses this operator.
I have yet to port my bigger projects to it but if I write something cool I'll let ya know.
Have a cool example now. Calculating diff b/w subsequent values.
>>> data = [10, 14, 34, 49, 70, 77] >>> prev = 0; >>> [-prev + (prev := x) for x in data] [10, 4, 20, 15, 21, 7]
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Do you have any cool examples? I’m actually pretty excited to see how the community uses this operator.
I have yet to port my bigger projects to it but if I write something cool I'll let ya know.
Have a cool example now. Calculating diff b/w subsequent values.