Skip to content

Commit 00aada2

Browse files
committed
add Q1.py
1 parent 22bb9b3 commit 00aada2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

exercises/Q1.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'''Question:
2+
Write a program which will find all such numbers which are divisible by 7 but are not a multiple of 5,
3+
between 2000 and 3200 (both included).
4+
The numbers obtained should be printed in a comma-separated sequence on a single line.
5+
6+
Hints:
7+
Consider use range(#begin, #end) method'''
8+
9+
l = [x for x in range(2000, 3201) if x % 7 == 0 and x % 5 != 0]
10+
print(l)

0 commit comments

Comments
 (0)