From 8a35bc1a1f5f80dda0f6498ff32be1b7ec08113d Mon Sep 17 00:00:00 2001 From: Fatima Date: Thu, 5 Oct 2023 19:40:00 +0530 Subject: [PATCH] Check the leap year in python --- EM9CoR/dvvqnm.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 EM9CoR/dvvqnm.py diff --git a/EM9CoR/dvvqnm.py b/EM9CoR/dvvqnm.py new file mode 100644 index 00000000..e6438fcb --- /dev/null +++ b/EM9CoR/dvvqnm.py @@ -0,0 +1,5 @@ +is_leap_year = lambda year: (year % 4 == 0 and year % 100 != 0) or (year % 400 == 0) +# takes the input from user +year = int(input("Enter a year: ")) +if is_leap_year(year): print(year, " is a leap year") +else: print(year, "is not a leap year.") \ No newline at end of file