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?
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?
from math import sqrt
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 )
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.