Member Avatar for leegeorg07

Hi again but i seem to have a problem

whenever i try to use the sqrt() function it says that sqrt() doesn't exist.
can anyone help me?

Recommended Answers

All 2 Replies

To use the functions that a module contains, you need to import them first, like Aia showed.
Option #1:

import math
math.sqrt( x )

And option #2 (to import all functions from math):

from math import *
sqrt( x )
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.