Judging leap years. The user inputs a year, judges whether the year is a leap year, and outputs True and False respectively.

The year is a leap year when one of the following conditions is met:

(1) The year is a multiple of 4 Rather than a multiple of 100 (such as 2004 is, 1900 is not). (2) The year is a multiple of 400 (for example, it is in 2000 but not in 1900).

Complete program: stryear=input("Please enter the year:")

year=int(stryear)

Result=_____________________________________________________

print("The judgment result of a leap year is: "result)

+6

Votesresult=True

if (((year%4==0) and (year%100!=0)) or year%400==0)

Else result=False

Just use if-else statement to achieve

Gary Walker- October 15, 2020 |

+3

Votes“True” if (((year% 4 == 0) and (year% 100 != 0)) or year% 400 == 0) else “False”

Michelle Reid- October 16, 2020 |

+5

VotesThe result is 25

Raymond Collins- October 17, 2020 |

+3

Votesresult=(True if (((year%4==0) and (year%100!=0)) or year%400==0) else False)

Teresa Rose- October 17, 2020 |