simple operation question 2 >>> (4 + 8) / 2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

simple operation question 2 >>> (4 + 8) / 2

why the answer is 6.0 not 6 ?

18th Jan 2019, 1:47 PM
3IB Nasirah
3IB Nasirah - avatar
2 Answers
+ 3
basically you divide so you can get decimal so to get the same type always it is as float. to get full integer always use // or convert to int
18th Jan 2019, 4:14 PM
Hubert Dudek
Hubert Dudek - avatar
+ 2
18th Jan 2019, 2:29 PM
Gordon
Gordon - avatar