0
Why we add 0 in the end
Why (8+4)/2 the answer is 6.0 can't we print 6
2 ответов
+ 1
12//2=6 (integer division)
12/2=6.0 (automatic convert to floating point)
0
python 3 should automatically print the code as 6, you can however define the sum as an int before you print it i.e.
n = int(8+3)/2
print(n)
this would print "6"
similarly you can use float as such:
n = float((8+2)/2)
print(n)
this would print 6.0