This program raises "math is not defined error" How do I fix this error? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

This program raises "math is not defined error" How do I fix this error?

from math import sqrt print(math.sqrt(25)) #error statement

13th Aug 2020, 3:50 AM
Model Pilot
Model Pilot - avatar
3 Réponses
+ 4
Or: from math import sqrt as sqrt print(sqrt(25))
13th Aug 2020, 3:56 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 6
import math x = math.isqrt(25) print(x) # no error statement
13th Aug 2020, 3:57 AM
BroFar
BroFar - avatar
+ 4
import math print(math.sqrt(25))
13th Aug 2020, 3:54 AM
Rik Wittkopp
Rik Wittkopp - avatar