Skip to content

Commit 1e216f3

Browse files
author
zac11
committed
Added Level 1 Excercises solutions
1 parent 13828dd commit 1e216f3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Level1/Ex_1.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
3+
Write a program which will find all such numbers which are divisible by 7 but are not a multiple of 5,
4+
between 2000 and 3200 (both included).
5+
The numbers obtained should be printed in a comma-separated sequence on a single line.
6+
7+
8+
"""
9+
10+
list_numbers=[]
11+
for i in range(2000,3200):
12+
if (i%7==0) and (i%5!=0):
13+
list_numbers.append(str(i))
14+
15+
print(','.join(list_numbers))
16+
17+
18+
"""
19+
Output :
20+
2002,2009,2016,2023,2037,2044,2051,2058,2072,
21+
2079,2086,2093,2107,2114,2121,2128,2142,2149,2156,2163,
22+
2177,2184,2191,2198,2212,2219,2226,2233,2247,2254,2261,
23+
2268,2282,2289,2296,2303,2317,2324,2331,2338,2352,2359,
24+
2366,2373,2387,2394,2401,2408,2422,2429,2436,2443,2457,
25+
2464,2471,2478,2492,2499,2506,2513,2527,2534,2541,2548,
26+
2562,2569,2576,2583,2597,2604,2611,2618,2632,2639,2646,
27+
2653,2667,2674,2681,2688,2702,2709,2716,2723,2737,2744,
28+
2751,2758,2772,2779,2786,2793,2807,2814,2821,2828,2842,
29+
2849,2856,2863,2877,2884,2891,2898,2912,2919,2926,2933,
30+
2947,2954,2961,2968,2982,2989,2996,3003,3017,3024,3031,
31+
3038,3052,3059,3066,3073,3087,3094,3101,3108,3122,3129,
32+
3136,3143,3157,3164,3171,3178,3192,3199
33+
34+
"""

0 commit comments

Comments
 (0)