下列 Python 代码能够正确统计出所有能被 3 整除且至少包含一个数字 5 的四位数的个数。
count = 0for num in range(1000, 10000): if num % 3 == 0: digits = [int(d) for d in str(num)] if 5 in digits: count += 1print(count)下列 Python 代码能够正确统计出所有能被 3 整除且至少包含一个数字 5 的四位数的个数。
count = 0for num in range(1000, 10000): if num % 3 == 0: digits = [int(d) for d in str(num)] if 5 in digits: count += 1print(count)