LEAP YEAR

 def is_leap(year):

leap = False
# Write your logic here
if year%4==0:
leap=True
if year%100==0:
leap=False
if year%400==0:
leap=True
return leap


def days_in_month(year, month):
month = month - 1
leap=is_leap(year)
print (leap)
month_days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if leap==1:
month_days [1]=29

return month_days[month]
#🚨 Do NOT change any of the code below
year = int(input("Enter a year: "))
month = int(input("Enter a month: "))
days = days_in_month(year, month)
print(days)













Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings