def is_leap(year):
if year % 4 == 0:
print("year is a leap year")
elif year % 400 == 0:
print("year is a leap year")
elif year % 100 == 0:
print("not a leap year")
else:
("Not a leap year")
is_leap(2019)
- here i have entered the year 2019 which is not leap year but my program is not giving me out put of that if you enter a non leap year it want give out put as not a leap year.
- if there is any type of mistake in my program regarding any thing please tell me.
- this are considerations in bellow points using which i created the program -->
- The year must be evenly divisible by 4;
- If the year can also be evenly divided by 100, it is not a leap year; unless...
- The year is also evenly divisible by 400. Then it is a leap year.
Aucun commentaire:
Enregistrer un commentaire