lundi 13 mai 2019

Can anyone explain to me what does the "if not x%2:" mean?

I am trying to understand this code but the "if not x%2:" is quite confusing. It has the same result as "if x==2".

count_even = 0
for x in range(1,9):
    if not x % 2:
         count_even+=1

Aucun commentaire:

Enregistrer un commentaire