Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Indent the code as per given in the above screenshot.
- #Run the code in python version 3.x.
- #Define the function to
- #identify the leap year.
- def leap_year(string):
- #Convert the string
- #in the integer.
- year = int(string)
- #Check the year to be leap year or not.
- if year % 4 == 0 and (year % 100 != 0
- or year % 400 == 0):
- #If the above condition will
- #be true then return true.
- return True
- #The else part.
- else:
- #If the above condition will not
- #be true then return false.
- return False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement