Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
leap year program issue
#1
Hi,

Can someone please help with the following program.

Can't seem to figure out where I am going wrong.

My program executes fine, just ends up giving the wrong result. Ex. 1992 is a leap year, but my program shows it's not.

a = int(input("Enter year : "))

if (a % 4) == 0:

   if (a % 100) == 0:

       if (a % 400) == 0:

           print("Tis is leeap year")

       else:

           print("not a leap year")

   else:

       print("not a leapp year")

else:

   print("No it ain't")
TIA
Reply


Messages In This Thread
leap year program issue - by jashajmera - Feb-04-2017, 07:20 AM
RE: leap year program issue - by Skaperen - Feb-04-2017, 07:38 AM
RE: leap year program issue - by wavic - Feb-04-2017, 11:00 AM
RE: leap year program issue - by ichabod801 - Feb-04-2017, 11:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to get year not the entire year & time mbrown009 2 883 Jan-09-2023, 01:46 PM
Last Post: snippsat
  Problem with module time and leap seconds Pedroski55 3 1,237 Oct-07-2022, 11:27 PM
Last Post: Pedroski55
  Issue with program not passing to other elif condition Abdirahman 6 2,101 Nov-21-2021, 07:04 AM
Last Post: Abdirahman
Photo Algorithm for leap year (structogramm coder_sw99 3 2,229 Jul-23-2021, 02:13 PM
Last Post: DeaD_EyE
  Leap Year Issue spalisetty06 3 2,220 Jul-02-2020, 03:29 PM
Last Post: bowlofred
  Facing issue with pyautogui program after PC upgrade Utkarsh29 2 2,945 Jul-15-2019, 05:20 PM
Last Post: Utkarsh29
  Leap Year MartinEvtimov 14 25,090 Mar-10-2017, 01:46 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020