Python Program to Print All Integers that Aren’t Divisible by Either 2 or 3

bookmark

for i in range(0,51):
    if(i%2!=0&i%3!=0):
        print(i)

 

Output

Case 1:
1
5
7
11
13
17
19
23
25
29
31
35
37
41
43
47
49