Last active
March 5, 2022 15:18
-
-
Save solen003/2d8127f8f9ca7cdb9d09e04e34415009 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.
This file contains 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. | |
by7_notby5 = [i for i in range(2000, 3201) if (i % 7 == 0) and (i % 5 != 0)] | |
print(by7_notby5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
by7_notby5 = [i for i in range(2000, 3201) if (i % 7 == 0) and (i % 5 != 0)]
print(by7_notby5)