3 ms·
As they say, with perl there's more than one way to do it (TMTOWTDI) and with python there is only one way. Both approaches have their merits. Like with maven,
by gilleain 1y ago
As they say, with perl there's more than one way to do it (TMTOWTDI) and with python there is only one way.
Both approaches have their merits. Like with maven, where I once saw a question on a forum that was like "how do I do X?" and the reply was basically "You can't, don't try to do so, as that's wrong".
- tzs 1y agoThere is usually more than one way to do it in Python, too. For example most people's Python fizzbuzz seem pretty different from mine: def fizzbuzz(n, *args): cur = ['' for x in range(1,n+1)] for m, postfix in args: cur = [y+postfix if x%m==0 else y for x, y in zip(range(1,n+1), cur)] cur = [str(x) if y == '' else y for x, y in zip(range(1,n+1), cur)] return cur print("\n".join(fizzbuzz(100, (3, 'fizz'), (5, 'buzz'))))
- m463 1y agoThe king wisely had the software developer beheaded, and they all lived happily ever after. :)
- Ferret7446 1y agoIn Python, there should be one obvious way to do it. Your way is clearly a joke or an abomination.
- revskill 1y agoYou are funny. I love it.