Python math module

0 votes
I have been using the built-in functions of Exponentiation and logarithms module in Python. But everytime I get the following error:

NameError: name 'sqrt' is not defined
 

I have tried using math.sqrt(4),sqrt(4) and sqrt(4.0) as substitutes but even these didn't work. Can anyone tell me what is wrong?
Nov 24, 2018 in Python by ana1504.k
• 7,910 points
547 views

1 answer to this question.

0 votes
pow is built into the language but you have to import math first.

Try the following:

import math
math.sqrt(4)
answered Nov 24, 2018 by SDeb
• 13,300 points

Related Questions In Python

0 votes
0 answers

what is the use of python math module?

what are different functions that we can ...READ MORE

Jun 7, 2019 in Python by Waseem
• 4,540 points
329 views
+1 vote
7 answers
0 votes
1 answer

How to install Python MySQLdb module using pip?

It's easy to do, but hard to ...READ MORE

answered Aug 20, 2018 in Python by charlie_brown
• 7,720 points
1,661 views
+3 votes
1 answer

Tensorflow 1.5 ImportError: No module named tensorflow.python.client

I think it's a bug in Tensorflow ...READ MORE

answered Sep 25, 2018 in Python by charlie_brown
• 7,720 points
6,571 views
0 votes
2 answers
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,023 views
0 votes
1 answer
0 votes
1 answer

Difference between module and Package in Python

A module is basically a single file ...READ MORE

answered Nov 13, 2018 in Python by SDeb
• 13,300 points
2,104 views
0 votes
1 answer

Python sort() function arguments

Both sort and sorted have three keyword arguments: cmp, key and reverse. L.sort(cmp=None, key=None, reverse=False) -- ...READ MORE

answered Oct 8, 2018 in Python by SDeb
• 13,300 points
7,358 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP