In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
Python how to find the square root, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.
1. Open the IDLE,File--New File of python and create a new file
2. Enter the code in the empty file, File--Save, or Ctrl+s to save the file anywhere on the computer, press the keyboard F5 directly, or Run--Run Module to execute the code.
3. when running, enter a, b, c and press enter on the keyboard to get the following result
Second, code analysis
D = (breadbasket 2)-(4*a*c)
That is, d equals the square of b minus 4ac
Sol1 = (- b-cmath.sqrt (d)) / (2yoga)
According to the direct calculation of mathematical publicity, sqrt is the square root function.
Print ('result is {0} and {1}' .format (sol1,sol2))
Output the corresponding sol1 and sol2
Matters needing attention
1. When entering each line of code, each line must be aligned, and if there are spaces, the number of spaces must be the same.
2, pay attention to the double quotation marks "", where the double quotation marks function is the same as the single quotation marks, must be in the English input method, can not be entered under the Chinese input method, otherwise the program will run error.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.