I want to print numbers from 1-100 skipping the numbers divisible by 3 & 5 and when I use the code-1 I'm not getting the correct output, I am getting full counting 1-100
#CODE1
i=1
a=1
while i<=100:
if (a%3==0 and a%5==0) :
a=a+1
else:
print(a)
a=a+1
i=i+1
but when I use the CODE-2 I am getting the desired result
#CODE2
i=1
a=1
while i<=100:
if ((a%3 and a%5)==0) :
a=a+1
else:
print(a)
a=a+1
i=i+1
notice the fourth line of the code, why is wrong with the 1st code?