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.
This comment makes the assumption that speed is important. Per this kata, speed is not a requirement.
Over engineering = adding/assuming unnecessary requirements.
If all reqirements are met: DONE.
what the :o
@FutureScience
https://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html. Eval is dangerous when it is casted upon user input but it is fine in the rest of the code as long as the string being evaluated is safe. In this context it is bad because it is evaulating an input parameter which the user can possibly change.For example:
calc("5 1 2 + 4 * + 3 - 5 + __import__('os')._exit(0)")
would exit the program.Can you explain the exact meaning of "security issue"?
Sorry, It's my style ;-)
Hey! Your code looks pretty nice, but it could use for more whitespace (e.g. around operators) to make it more readable.
Eval is probably inadvisable because it puts a pretty bad security issue in your code.
Get rid of the [], you don't need them, sum() can take a generator expression, which improves speed by not pointlessly generating a list.
This comment is hidden because it contains spoiler information about the solution