The code below represents one method of writing the program using list comprehension and generators.
comp = (num for num in range(2000, 3201) if num % 7 == 0 and num % 5 != 0)
print(comp)
for item in comp:
print(item, end =", ")
This is another way of doing it, using again both list comprehension and generators, however this time, the code makes use of the * symbol inside of the print function.
print(* (i for i in range(2000, 3201) if i % 7 == 0 and i % 5 != 0), sep=", ")
What is the reasoning behind * being used here, given that without it, iterating over the generator would be impossible.