jeudi 22 août 2019

how to write a code in python to print all values from 1 to 100 .skip the numbers which are divisible by 3 or 5

I want to print numbers from 1 to 100 skipping the numbers divisible by 3 or 5 but when I use the code I am getting wrong output.

i=1

while i<=100:
    if((i%3 | i%5)!=0):
        print(i)
    i+=1

Aucun commentaire:

Enregistrer un commentaire