I think if you look closer, you'll see that my solution is equivalent in output to the OP's example.
Here's a nastier one (also with a py3 equivalent)
# python2 def really_silly(bar): return ["MAYBE","YES","NO"][cmp(bar,0)] # python3 def extremely_silly(bar): return ["MAYBE","YES","NO"][(bar>0)-(bar<0)]
God, I love how awful python can get sometimes!
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.
I think if you look closer, you'll see that my solution is equivalent in output to the OP's example.
Here's a nastier one (also with a py3 equivalent)
God, I love how awful python can get sometimes!