+ 2
In python. print ( 9 * * ( 1/ 2 ) ) = 3.0
Can anyone explain or iterate this... Please
4 Answers
+ 7
Chandana M
You used back slash instead of divisor operator
print (9**(1/2))
Will give 3.0 as output
+ 11
'**' is the exponentiation operator
9**(1/2) is basically the square root of 9
Since 1/2=0.5, 9**0.5=3.0 (since exponent is a float, the output is a float)
+ 5
The correct syntax would be:
print(9 ** (1/2))
Here, the ** operator is used to calculate the power of a number. In this case, the number 9 is being raised to the power of 1/2, which is the same as taking the square root of 9. The print() function is then used to print the result to the screen.
The result of this code would be 3.0, which is the square root of 9.
I hope this helps! Let me know if you have any other questions.
+ 3
Okay Ria... But I want how it gonna work