year = raw input from the user while year is not "bye": year = int(year) if before 1582: if divisible by 4: leap year else: not a leap year else: if divisible by 4: note: potential leap year if divisible by 100: exception note: potentially not a leap year if divisible by 400: exception leap year else: no exception, so it's not a leap year else: no exception, so: leap year else: not a leap year get new year from user via raw input