I created this task because I came across this blog post and was shocked at how obtuse this seemingly simple operation is in Python. Then I did some searching and found that it's not trivial in C# or Lua, either.
So it's a nice clear task, easy to explain and useful enough that people ask on StackOverflow how to do it, but the solutions in at least some languages are nontrivial.
Made it a draft anyway because it's my very first time adding a task here. :) Ye venerated elders, feel free to switch it to a full task if you think that's warranted. JoeStrout (talk) 00:20, 14 January 2020 (UTC)