that the division to an integer python3

Learn python3 encounter problems:

Today in learning python, I want to use (121/100) results obtained for the integer 1,

121/100

outout:1.21

But the actual result is a float 1.21

Reason: After python3, the digital division of floating-point arithmetic default

Resolution: The / operator changed // to

121//100
output:1

 

Guess you like

Origin www.cnblogs.com/durianyang/p/11614565.html