mercredi 3 juillet 2019

Why does the second program work but not the first?

First :

a = int(input())
if a%4 == 0:
    a += 1
if a%4 != 0:
    a -= 1
print(a)

Second :

a = int(input())
b = a%4
if b == 0:
    a += 1
if b != 0:
    a -= 1
print(a)

Aucun commentaire:

Enregistrer un commentaire