Skip to content

Instantly share code, notes, and snippets.

@solen003
Last active March 5, 2022 15:18
Show Gist options
  • Save solen003/2d8127f8f9ca7cdb9d09e04e34415009 to your computer and use it in GitHub Desktop.
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.
#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)
@Hung-jpg
Copy link

Hung-jpg commented Mar 5, 2022

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