Home > other >  How to use python function body to judge whether a leap year
How to use python function body to judge whether a leap year

Time:10-09

How to use the function body (def) to determine whether a given year is a leap year
Another: the teacher said in the function body can't use the input input, can't use the print output, is why?

CodePudding user response:

The function returns with the return

CodePudding user response:

 def leapYear (year) : 
If (year % % 4==0 and year 100! 400===0) or year % 0:
Return True
The else:
Return False

The incoming parameters and return values
  • Related