Why in python when we write. Print((4+8) /2) the output is 6.0 | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
- 2

Why in python when we write. Print((4+8) /2) the output is 6.0

Please tell

27th Feb 2021, 5:28 AM
Jyotsana
Jyotsana - avatar
5 Respostas
+ 4
In Python, the "/" stands for floating point division, as opposed to the "//", which stands for integer division.
27th Feb 2021, 7:33 PM
Marvin
Marvin - avatar
+ 1
whenever the division operator is calculated the result by default is in float form. if you want to convert to integer use int( ).
27th Feb 2021, 5:31 AM
Central Processing Unit
Central Processing Unit - avatar
0
Thank you all for clearing my doubt
27th Feb 2021, 6:33 AM
Jyotsana
Jyotsana - avatar
0
6.0
23rd Mar 2022, 5:28 PM
Sai Sathvik
Sai Sathvik - avatar
0
Thank you everyone for your answers. I understood it. Once again thanks
17th May 2022, 5:32 AM
Jyotsana
Jyotsana - avatar