#Python "Why the output is 0" | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
4th Nov 2018, 9:37 AM
Fatih Yalçın
Fatih Yalçın - avatar
7 Answers
+ 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))
4th Nov 2018, 10:22 AM
Shubham Sharma
Shubham Sharma - avatar
+ 10
int of False is 0 and int of True is 1
4th Nov 2018, 9:46 AM
Yash✳️
Yash✳️ - avatar
+ 9
2**3 == 3**2 //false 2*2*2 == 3*3 // 8 == 9, that's why...
4th Nov 2018, 9:40 AM
Valen.H. ~
Valen.H. ~ - avatar
+ 2
False 0 and true 1
15th Nov 2018, 5:24 AM
Mohsin Khan
Mohsin Khan - avatar
+ 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
4th Nov 2018, 10:31 AM
KrOW
KrOW - avatar
0
Because 9**19 is the same as 9**19
4th Nov 2018, 9:38 AM
PureLogicality
PureLogicality - avatar
0
I can also tj same thing
2nd Jul 2019, 5:09 PM
Sent