I have imported 'from math import *' and tried to run x = math.e print x (indented properly) but it says error name 'math' is not defined. Using function from Python Standard Library http://docs.python.org/library/math.html
Hoot! You just asked your first question! Hang tight while I find people to answer it for you. You can thank people who give you good answers by clicking the 'Good Answer' button on the right!
try "import math" instead of "from math import *"
if "import math" is used instead of "from math import *" the functions of the math module will have to be called as methods of the math class (excuse me if I accidentally misuse terminology... I'm just reading "how to think like a computer scientist" and try to apply the concepts I learned in the book), for example, instead of writing sqrt() one would have to write math.sqrt() and so on...
Join our real-time social learning platform and learn together with your friends!