Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
why cast to float ? the results are float anyway .....
You're right about anti-pattern. However this code is made for golfing purpose - writing shortest solution possible - certainly not for production, so it doesn't need to enforce PEP8.
Lambda is an anynoums function. It is an antipattern assigning lambda function into a variable: https://www.python.org/dev/peps/pep-0008/#programming-recommendations
However,
s
is better thatstr
becausestr
is a built-in type in pythonNot really best practice, since in this approach
ord('a') -1
is computed for every char in string. Might be stored in some variable.It's a working solution, but pep8 will complain about undescriptive variable name.
As @eightyeightyeyes mentioned - it's not 'pythonic' way to shadow names like
str
,id
etc.This comment is hidden because it contains spoiler information about the solution