python math.sqrt() method example
Python[Edit]
+
0
-
0
Python math.sqrt() method example
1 2 3 4 5 6 7 8 9import math print( math.sqrt( 4 ) ) # 2 print( math.sqrt( 9 ) ) # 3 print( math.sqrt( 2 ) ) # 1.4142135623730951 print( math.sqrt( 0.5 ) ) # 0.7071067811865476 print( math.sqrt( 0 ) ) # 0 print( math.sqrt( -1 ) ) # ValueError