case = 1
while case == 1: try: year = int(input("Enter year")) except: print("Invalid input")
if year < 9999 and year > -9999:
if year > 5000 or year < -46 or year == 0:
print("Year",year,"Invalid Year")
else:
if year >= -46 and year <= 1752:
if year % 4 == 0:
print("Year",year,"Julian Leap Year")
else:
print("Year",year,"Julian Non Leap Year")
else:
if year >= 1753:
if year % 4 == 0:
if year % 100 == 0:
if year % 400 == 0:
print("Year",year,"Gregorian Leap Year")
else:
print("Year",year,"Gregorian Non Leap Year")
else:
print("Year",year,"Gregorian Leap Year")
else:
print("Year",year,"Gregorian Non Leap Year")
else:
print("goodbye!")
case = 0
Basically, my question is, is this a good programming style? Is there a more efficient way to do this rather than a bunch of if statements or is programming completely dependent on how you see it flow? Everything works correctly so disregard any output or context. Purely asking about the format.