Excercise # 2 Write a function def isLeapYear(year) that tests whether a year is a leap year, that is, a year with 366 days. Note that a year is a leap year if it is divisible by 4 but not by 100, or...


Excercise # 2 Write a function def isLeapYear(year) that tests whether a year is a leap year, that is, a year with 366 days. Note that a year is a leap<br>year if it is divisible by 4 but not by 100, or if it is divisible by 400.<br>• Following are sample runs:<br>enter a year number: 1600<br>1600 is a leap year<br>enter a year number: 2020<br>2020 is a leap year<br>enter a year number: 1000<br>1000 is not a leap year<br>Slide Type<br># YOUR CODE HERE<br># Hint: if (year%4=30 and year %100 !=0) or year%400 == e:<br>def isleapYear(year):<br># Write the code of the function here<br>def main():<br>year = int(input(

Extracted text: Excercise # 2 Write a function def isLeapYear(year) that tests whether a year is a leap year, that is, a year with 366 days. Note that a year is a leap year if it is divisible by 4 but not by 100, or if it is divisible by 400. • Following are sample runs: enter a year number: 1600 1600 is a leap year enter a year number: 2020 2020 is a leap year enter a year number: 1000 1000 is not a leap year Slide Type # YOUR CODE HERE # Hint: if (year%4=30 and year %100 !=0) or year%400 == e: def isleapYear(year): # Write the code of the function here def main(): year = int(input("enter a year number: ")) main ()

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here