1、Write a program which will find all such numbers which are divisible by 7 but are not a multiple of 5, between 2000 and 3200 (both included).The numbers obtained should be printed in a comma-separated sequence on a single line.
写一个程序,找出2000到3200之间的所有这些可以被7整除但不是5的倍数的数字。得到的数字应该用逗号分隔的顺序打印在一行上。
for i in range(2000,3201):
if i % 7 == 0 and i % 5 != 0 :
print(i,end = ",")
print("\b")
输出为:
2002,2009,2016,2023,2037,2044,2051,2058,2072,2079,2086,2093,2107,2114,2121,2128,2142,2149,2156,2163,2177,