i % 10 == 9: Understanding the Modulo Operator in Programming
This expression checks if the remainder of the division of "i" by 10 is equal to 9. The modulo operator (%) gives you the remainder after integer division. So, if the remainder is 9, it means that "i" ends in the digit 9. For example, 19 % 10 == 9 and 29 % 10 == 9.
原文地址: https://www.cveoy.top/t/topic/pQMI 著作权归作者所有。请勿转载和采集!