Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to enter the root number for python

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)05/31 Report--

Most people do not understand the knowledge of this article "python how to enter the root", so the editor summarizes the following, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to enter the root of python" article.

The first method

To use the math module, you need to call it before use, as follows

The second method

Use the built-in function pow (), as follows

The third method

Use mathematical expressions

The python root function def panduan (x): # first determines which two integers a given number is between. For i in range: if xi*i: return i; elif x==i*i: # if it can be obtained directly, it will be output directly. Print (I) return-1; elif x

< 0: #若为负数则提示。 print("请输入大于0的数字!") return -1def bijin(list): #用两个数字通过除二逐渐逼近这个结果 t = (list[0]+list[1])/2 if x >

List: list [0] = t else: list [1] = tx = float (input ("Please enter:") y = panduan (x) if y! =-1: list = [ythesis 1] while list [0] * 10000000000000 = 0: # here you can control the number of places after the decimal place. Replaced by 10 places I can control decimal places bijin (list) print (list [0]) above is about "python how to enter the root" the content of this article, I believe we all have a certain understanding, I hope the editor to share the content to help you, if you want to learn more related knowledge content, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report