0
Hi friends i'm solving problem 23.2 in python for beginners and i can't figure out what's wrong with my code
year = int(input()) if year %4==0: print ("Not a Leap year") elif year%100!= 0: print ("Not a Leap year") else: if year% 400 == 0: print ("Leap year")
1 Odpowiedź
0
Years that are divisible by 400 are also divisible by 100. Once a year satisfies your second condition, it won't go on to the third. Therefore you need to check if a year is divisible by 400 before checking that it's divisible by 100.