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.
@JefeThePug: if you post code, better to fork the kumite.
eval is unsafe, avoid using it
Fair enough reasoning, I suppose.
If its software running locally, its fine. I would not reccomend this for networked applications.
This is a bad idea - what if someone did something like this:
Calculator("+ 0;", "0 ", "print('Thanks eval')")
? It may be shorter but you have just opened up this simple program to vulnerabilities.yeah, I saw it, eval based solution is kinda first that comes to mind and considers vulnerable, I'd like to show another options
Glad you like my solution, Ive made an improved version below, that uses eval. So it's less code and makes more operators available.
right,
reduce
can be rid of.This is a bad calculator since there is no lexical analysis (input would be
"10 + 10"
). Try making it better and expand on it so it supports powers (**), lets you use more that one expression ("10 + 10 / 2
) WITH the order of calculation. Sure you can do some good things with it.