7 kyu
Polynomials I: String Format
235raulbc777
Loading description...
Fundamentals
Mathematics
Strings
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
python new test framework is required. updated in this fork
Approved!
Very cool how you introduce ast in a simple gentle way. Bravo!
Tests are printing stuff to the console, and misusing
describe
andit
blocks.fixed in latest fork.
Python 3 should be enabled.
Done.
I'm imagining to exec some
rm -rf
in such a calculator, should it be used anywhere ^^OMG, thoughts about fixing that?
It's not fixable.
ast.compile
generates a code object foreval
orexec
from Python code. That being said, don't worry. The file system isn't writeable (beside/tmp
).It's a thing solutions may or may not check, so the question is not whether it's fixable but whether it should be tested. It most likely shouldn't. As for the method, it's possible to traverse the AST and check its nodes against a whitelist. For such an easy problem, however, that would be overkill.