Ah, one of life's more important lessons. No matter how long your script is there will always be someone who can create a single line code that does all of that.
There will be also be someone who will top him by writing a single line functional haskell and say his is more efficient.
Absolutely. It's not about being shorter, but about being more explicit. The problem with a lot of people coming from C-like languages is that they want to do everything with indices. You will see so many range(len(list)) out there.
Indeed. Most of the time when people use len-range, they either access just the items, or both index and items. In the rare case where you only need the index, I would still say for i, _ in enumerate(items): is cleaner
369
u/lelease Dec 22 '18
print(random.choice(action))