Skip to content

Instantly share code, notes, and snippets.

@Sangram92
Created March 18, 2016 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sangram92/167f1bcc860dc5ee5d04 to your computer and use it in GitHub Desktop.
Save Sangram92/167f1bcc860dc5ee5d04 to your computer and use it in GitHub Desktop.
"""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.
"""
result = []
for num in range(2000, 3201):
if num % 7 == 0 and num % 5 != 0:
result.append(num)
print ",".join('%s'%i for i in result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment