I know I'm missing something very simple, but I cannot for the life of me figure it out. Here's what I have right now.
def days_in_feb(user_year):
if user_year % 100 == 0:
if user_year % 400 == 0:
user_year = print(f'{user_year} has 29 days in February.')
else:
user_year = print(f'{user_year} has 28 days in February.')
else:
if user_year % 4 == 0:
user_year = print(f'{user_year} has 29 days in February.')
else:
user_year = print(f'{user_year} has 28 days in February.')
return user_year
if __name__ == '__main__':
user_year = int(input())
print(f'{days_in_feb(user_year)}')
It will run fine once but then when it goes to take the next input, I get "days_in_feb() did not return a value. Your function may be missing a return statement." I think it has something to do with reassigning user_year to those print statements in the function but without them I don't know what to return.