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]

Python 函数生成11的倍数且个位数为9的列表