{"id":178980,"date":"2022-04-13T19:16:17","date_gmt":"2022-04-13T11:16:17","guid":{"rendered":"http:\/\/www.idc.net\/help\/178980\/"},"modified":"2022-04-13T19:16:17","modified_gmt":"2022-04-13T11:16:17","slug":"%e5%90%8e%e6%b5%aa%e4%ba%91python%e6%95%99%e7%a8%8b%ef%bc%9apython%e4%b8%adsqrt%e5%95%a5%e6%84%8f%e6%80%9d","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/178980\/","title":{"rendered":"\u540e\u6d6a\u4e91Python\u6559\u7a0b\uff1apython\u4e2dsqrt\u5565\u610f\u601d"},"content":{"rendered":"<p style=\"text-align: center\"><img decoding=\"async\" src=\"https:\/\/oss.py.cn\/pycn\/upload\/article\/000\/000\/004\/5d888a112050e319.jpg\" class=\"aligncenter\"><\/p>\n<p>python\u4e2d\u6709\u5f88\u591a\u7684\u5185\u7f6e\u51fd\u6570\uff0c\u8fd9\u4e9b\u51fd\u6570\u80fd\u5b9e\u73b0\u7279\u5b9a\u7684\u529f\u80fd\uff0c\u800c\u4e0d\u9700\u8981\u91cd\u65b0\u5b9a\u4e49\u51fd\u6570\u3002\u4e0b\u9762\u770b\u4e00\u4e2amath\u6a21\u5757\u4e2d\u7684sqrt()\u51fd\u6570\u3002<\/p>\n<p>sqrt() \u65b9\u6cd5\u8fd4\u56de\u6570\u5b57x\u7684\u5e73\u65b9\u6839\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f sqrt() \u65b9\u6cd5\u7684\u8bed\u6cd5:<\/p>\n<pre>import&nbsp;math\nmath.sqrt(&nbsp;x&nbsp;)<\/pre>\n<p>\u6ce8\u610f\uff1asqrt()\u662f\u4e0d\u80fd\u76f4\u63a5\u8bbf\u95ee\u7684\uff0c\u9700\u8981\u5bfc\u5165 math \u6a21\u5757\uff0c\u901a\u8fc7\u9759\u6001\u5bf9\u8c61\u8c03\u7528\u8be5\u65b9\u6cd5\u3002<\/p>\n<p>\u53c2\u6570\uff0cx -- \u6570\u503c\u8868\u8fbe\u5f0f\u3002<\/p>\n<p>\u8fd4\u56de\u503c\uff0c\u8fd4\u56de\u6570\u5b57x\u7684\u5e73\u65b9\u6839\u3002<\/p>\n<p>\u5b9e\u4f8b<\/p>\n<pre>#!\/usr\/bin\/python\nimport&nbsp;math&nbsp;&nbsp;&nbsp;#&nbsp;This&nbsp;will&nbsp;import&nbsp;math&nbsp;module\n\nprint&nbsp;\"math.sqrt(100)&nbsp;:&nbsp;\",&nbsp;math.sqrt(100)\nprint&nbsp;\"math.sqrt(7)&nbsp;:&nbsp;\",&nbsp;math.sqrt(7)\nprint&nbsp;\"math.sqrt(math.pi)&nbsp;:&nbsp;\",&nbsp;math.sqrt(math.pi)<\/pre>\n<p>\u8fd4\u56de\u7ed3\u679c<\/p>\n<pre>math.sqrt(100)&nbsp;:&nbsp;&nbsp;10.0\nmath.sqrt(7)&nbsp;:&nbsp;&nbsp;2.64575131106\nmath.sqrt(math.pi)&nbsp;:&nbsp;&nbsp;1.77245385091<\/pre>\n<p>\uff08\u66f4\u591a\u5b66\u4e60\u5185\u5bb9\uff0c\u8bf7\u70b9\u51fbpython\u5b66\u4e60\u7f51\u3002\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>python\u4e2d\u6709\u5f88\u591a\u7684\u5185\u7f6e\u51fd\u6570\uff0c\u8fd9\u4e9b\u51fd\u6570\u80fd\u5b9e\u73b0\u7279\u5b9a\u7684\u529f\u80fd\uff0c\u800c\u4e0d\u9700\u8981\u91cd\u65b0\u5b9a\u4e49\u51fd\u6570\u3002\u4e0b\u9762\u770b\u4e00\u4e2amath\u6a21\u5757\u4e2d\u7684sq [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":178981,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[182397],"tags":[],"class_list":["post-178980","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/178980","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=178980"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/178980\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/178981"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=178980"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=178980"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=178980"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}