CODE : def days_in_feb(user_year):     is_leap_year = 29     not_leap_year = 28     if user_year % 4 ==0:         return is_leap_year     elif user_year % 4 ==0 and user_year % 100 == 0 and user_year % 400 == 0:         return is_leap_year     else:           return(not_leap_year)      if __name__ == '__main__':     # Type your code here. Your code must call the function.     user_year = int(input())     days = days_in_feb(user_year)     print(user_year,'has', days, 'days in February.')   ERROR OUTPUT IS NOT WORKING FOR YEAR 1900   Input 1712 Your output 1712 has 29 days in February.   Your output days_in_feb(1913) correctly returned 28   days_in_feb(1600) Your output days_in_feb(1600) correctly returned 29 4: Unit testkeyboard_arrow_up 0 / 3 days_in_feb(1900) Your output days_in_feb(1900) incorrectly returned 29

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

CODE :

def days_in_feb(user_year):
    is_leap_year = 29
    not_leap_year = 28
    if user_year % 4 ==0:
        return is_leap_year
    elif user_year % 4 ==0 and user_year % 100 == 0 and user_year % 400 == 0:
        return is_leap_year
    else:  
        return(not_leap_year)
    
if __name__ == '__main__':
    # Type your code here. Your code must call the function.
    user_year = int(input())
    days = days_in_feb(user_year)
    print(user_year,'has', days, 'days in February.')

 

ERROR

OUTPUT IS NOT WORKING FOR YEAR 1900

 

Input
1712
Your output
1712 has 29 days in February.
 
Your output
days_in_feb(1913) correctly returned 28
 
days_in_feb(1600)
Your output
days_in_feb(1600) correctly returned 29
4: Unit testkeyboard_arrow_up
0 / 3
days_in_feb(1900)
Your output
days_in_feb(1900) incorrectly returned 29
 
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Linux
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage