1、代码
import math
a = math.sqrt(4)
print(a)
2、结果
2
3、说明
python根号是使用math模块中的sqrt()
第一种方法:使用math模块,使用之前需要先调用。第二种方法:使用内置函数pow()。
第三种方法:使用数学表达式。
python学习网,免费的在线学习python平台,欢迎关注!
1、代码
import math
a = math.sqrt(4)
print(a)
2、结果
2
3、说明
python根号是使用math模块中的sqrt()
第一种方法:使用math模块,使用之前需要先调用。第二种方法:使用内置函数pow()。
第三种方法:使用数学表达式。
python学习网,免费的在线学习python平台,欢迎关注!