Is there a short-hand for nth root of x in Python

后端 未结 8 1046
闹比i
闹比i 2020-12-03 09:37

Simple syntax question.

In maths if I have two number 3 and 2 and I wish to calculate 3 to the power of 2 then no symbol is required but I write the two small. In

相关标签:
8条回答
  • 2020-12-03 10:25

    Basically sqrt(9) is equivalent to 9^.5

    >>>9**.5
    3.0
    
    0 讨论(0)
  • 2020-12-03 10:29

    You should do

    16**(0.5) #If you print it, you get 4, So you can use this formula.
    
    0 讨论(0)
提交回复
热议问题