Python Institute lab 3.1.1.13

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

I think the year % 100 != 0 code doesnt have function so it will make the program become more complex, i prefer to write my code like this if want to use the % 100 rule :

year=int(input("Input="))

if year<1582:
print("Not within the Gregorian calendar period")
elif year % 400 == 0 :
print("Leap year")
elif year % 100 == 0 :
print("Common year")
elif year % 4 == 0 :
print("Leap year")
else :
print("Common year")

fernandotobing
Автор

year = int (input ("Enter a year:"))

if year <1582:
print ("It is not in the Gregorian calendar")
elif year% 4! = 0:
print ("It's a common year")
the rest:
print ("It's a leap year")

Why does it keep working like this the same?

yessicacardenas