Created
March 18, 2016 13:03
-
-
Save Sangram92/167f1bcc860dc5ee5d04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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