I thought about this but thought there might be some longer years thrown in exactly because of this. Then again, "YYYY" does imply only four-digit years would be used...
This one looks both, clever and clean.
Writing clean code is more important than writing clever code.
what is it '\D'?
why cant I be this clever?
Ok, I see where is my problem. I wrote solution for Python3, where range() function returns range object. In python2 that function returns list. Thanks for help
I'm not sure I understand your question. For one thing, in Python a list is an object (practically everything is an object in Python) so I don't understand this objection. As far as how this works, all it does is call the "range" function:
Have you tried reading the relevant documentation? If so, maybe you could say a little bit more about what you find confusing. You could also try asking for help on the Codewars gitter:
how does this work? This function returns range object instead of list. Am I missing something?
PEP8: "Comparisons to singletons like None should always be done with is or is not , never the equality operators. "
This comment is hidden because it contains spoiler information about the solution