+ 1
What is the right answer
9**(1/2) . What is the output 1 or 3....1 in python 2.7....3 in example of solo learning..
5 ответов
+ 1
Okay, so 9**1/2 = 9**0.5 = √9
In this scenario, the 0.5 is float value and 9 is integer value. If you declare 0.5 as integer, it will automatically round the number down, so you will be left with 0 (because it will only display a number before a decimal mark)
So for example if you have a**b, where b is anything between 0 and 1 and it is saved as an integer, you will always have b = 0, which will make the a**b always 1.
Do you understand it better now?
0
3. It probably shows 1 because it rounded it down to 9**0 (since it is int)
0
I am just a beginner.. I don't Understand yet
0
Yeas... Very clear.. Thank you