https://ostad.plus/python-code-producing-incorrect-results-check-this/