from __future__ import division used

Copyright statement: Visitors can use the content or services provided by this blog for personal study, research or appreciation, and other non-commercial or non-profit purposes, but at the same time, they should abide by the provisions of copyright law and other relevant laws, and shall not infringe this The legal rights of the website and related rights holders. In addition, when using any content or services of this website for other purposes, you must obtain the explicit permission of this website and relevant rights holders in a timely manner. https://blog.csdn.net/qq_38262728/article/details/89057217

In python2, division of integers rounds down the result.

So if you want to calculate the exact calculation result, you need to join from future import division.

The version above python3 does not need this operation.