vendredi 23 avril 2021

I want to print the numbers from 1 to 100 and skip the numbers divisible by 3 or 5. I made an indentation mistake I got two values. what is the logic?

printing the numbers 1 to 100 and skipping the numbers divisible by 3 or 5


'''
i = 1
while i<=100:
    if not(i%3==0 or i%5==0):
        print(i,end="   ")
        i=i+1  ***indentation mistake***
'''

Aucun commentaire:

Enregistrer un commentaire