Last active
January 4, 2023 15:09
-
-
Save narma/858372 to your computer and use it in GitHub Desktop.
Why ruby is better than python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ", ".join(["%s: %s" % (k,v) for k,v in filter(lambda k,v: v, some_hash.items())]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| some_hash.select { |k,v| v and !v.zero? }.collect { |k,v| "#{k}: #{v}" }.join ", " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment