Better than mine.
I like this method.
How does this satisfy all 5 lines of the test?
I Can only get the first line to pass, and never the second
I love oneliners, especially when they are so clear and easy to read! .endswith is what I was looking for. Domo arigato.
Yes, (s+'_') made more step
I just fixed the code.
I think this is because range returns a list in python 2.7, whereas in python3, it returns an iterator, which needs to be casted to a list.
Worked fine for me, code issue?
I thought this solution was nice and neat but when I try to run it in Jupyter, it doesn't perform as expected. I get 'Beautiful is better than ugly.\nExplicit is better than implicit.\nSimple is better than complex.\nComplex is better than complicated.' I copy and pasted the above code so why doesn't the "\n" actually print a new line? I've run into this issue before (I'm still a newb) where I've tried to use "\n" and instead of it printing a new line, it prints \n within the string. Can anyone explain why this is occurring?
Thanks for any insight!
Cool, thanks for spotting it, Tachyon :)
Happy now. :-)
No, try now.
Right, thanks: Python fixed
Using assert_equals in Python's random tests.