0
#Python "Why the output is 0"
7 Antworten
+ 11
As I can see the values of 9**19 and float(9**19) :
The float value becomes more significant as it becomes very large (scientific notation), therefore on converting it back to int the value changes.
You can try printing values of 9**19 and float(9**19) and then int(float(9**19))
+ 10
int of False is 0 and int of True is 1
+ 9
2**3 == 3**2 //false
2*2*2 == 3*3 // 8 == 9, that's why...
+ 2
False 0 and true 1
+ 1
Using float can lead you to lose some precision then, converting it to int, get you a "less" precised int of which you expected
0
Because 9**19 is the same as 9**19
0
I can also tj same thing