Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def leap_year(year):
- return (year % 4 == 0 and year % 100 != 0) or year % 400 == 0
- def days_diff(year1, year2):
- diff = (year2 - year1) * 365
- for year in range(year1, year2):
- if leap_year(year):
- diff += 1
- return diff
- if __name__ == "__main__":
- year1 = int(input('year1='))
- year2 = int(input('year2='))
- print("day diff: " + str(days_diff(year1, year2)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement