ImportError: No module named math

Add a reply

Posted by gsakkis 794 days ago:
I submitted a python script and the test failed with this error. Is this a bug or a "feature" ?
Posted by jojo 792 days ago:
I submitted a python script and the test failed with this error. Is this a bug or a "feature" ?

this is a feature. the rules say that you cannot import any modules. this is make you write your own code.

however, it seems that "import math" is necessary in python to get really basic functions like floor and sqrt? because the other languages have these functions as standard, there is an argument for allowing this python module. "import re" was allowed for python by the same argument, because the other languages include regexp support without modules.

there is a thread in the python forum where carldr asks which other python modules are justified. i suggest that you post "math" there. if you know any of the other languages, you might also consider making cases for any other python modules that implement features that are always available in the other languages.

Add a reply