+ 1

Doubt function def python 3

Hello, here is a "code" that determines which year is leap year. year = input ("write the year") def type_year (year): if year% 4 == 0: print ("the year", year, "is leap") elif year% 400 == 0: print ("the year", year, "is leap") else: print ("year", year, "not leap") The problem I have is that it does not return which year is leap or not, what is wrong with this code?

12th Apr 2020, 1:26 AM
Pablo Corvera
Pablo Corvera - avatar
2 Réponses
+ 2
Hiii bro , condition should be year%4 & year&100 otherwise it will be error ful
12th Apr 2020, 1:37 AM
Raj Kalash Tiwari
Raj Kalash Tiwari - avatar