Python 函数生成11的倍数且个位数为9的列表
def multiple_of_11_and_9(n): result = [] for i in range(n): num = 11 * (i + 1) if num % 10 == 9: result.append(num) return result
示例
print(multiple_of_11_and_9(5)) # [99, 209, 319, 429, 539]
原文地址: https://www.cveoy.top/t/topic/nBe9 著作权归作者所有。请勿转载和采集!