Python 2.7 我想知道如何在python中生成一个平方根,这样当用户键入一个数字时,它会将该数字的平方根提供给用户

Python 2.7 我想知道如何在python中生成一个平方根,这样当用户键入一个数字时,它会将该数字的平方根提供给用户,python-2.7,Python 2.7,请帮我回答这个问题我已经被困了几个小时了: 如何给用户输入的数字的平方根?希望这个世界上的一些人知道怎么做。我在互联网上搜索了几个小时,结果一无所获 import math # So that we can use the sqrt() function user_inp = float(input()) # takes in user input value and converts it to float print (math.sqrt(float(user_inp))) #shows

请帮我回答这个问题我已经被困了几个小时了:

如何给用户输入的数字的平方根?希望这个世界上的一些人知道怎么做。我在互联网上搜索了几个小时,结果一无所获

import math # So that we can use the sqrt() function
user_inp = float(input())  # takes in user input value and converts it to float
print (math.sqrt(float(user_inp))) #shows the square root answer to the screen