0
My program gives me 6 instead of 6.0 when I execute 12/2?
7 Answers
+ 4
then you have Python 2. Please use Python 3 instead.
+ 3
2.7 is very good as well as 3.x... because still a lot of Python 2.x are running in production. And as 3.x is a major changement version, stability and ecosystem compatibiity ( not all libraries/module have yet been ported in 3.x ) is still in favour of 2.x ^^
So learning/knowing 2.7 is a good idea, and learning the few differences or how to upgrade 2.7 behaviour to 3.x one is so easy :P
+ 2
you can try:
12.0/6 or float(12)/6
+ 2
0
16//2
try that code. the double division bar
0
@Nahuel you should try to read the questions before answering. also stop upvoting your own wrong answers. *facepalm*
0
Thank you guys I just uninstalled the 2 7 I got I installed 3.5 and problem solved