Python统计区间内满足条件的数字
m = input('请输入m:') n = input('请输入n:')
if not m.isdigit() or not n.isdigit(): print('error') else: m = int(m) n = int(n) count = 0 for i in range(m, n+1): if i % 3 == 2 and '6' in str(i): count += 1 print(count)
原文地址: https://www.cveoy.top/t/topic/nE0Y 著作权归作者所有。请勿转载和采集!