title: Python leap year calculator (between two years selected by the user)
body: <p>I can't find the correct loops to use to make this code work!</p>
  
  <p>I tried to use a while loop and I could get Python to show all the leap years between the two years selected by the user but not in the formatting that I was asked to use.</p>
  
  <pre><code>start = int(input("Enter start year: "))
  end = int(input("Enter end year: "))
  
  if start &lt; end:
    print ("Here is a list of leap years between " + str(start) + " and " + str(end)  + ":")
  
   while start &lt; end:
      if start % 4 == 0 and start % 100 != 0:
          print(start)
      if start % 100 == 0 and start % 400 == 0:
          print(start)
      start += 1
  
  if start &gt;= end:
   print("Check your year input again.")
  </code></pre>
  
  <p>Problem description: A year is a leap year if it is divisible by four, except that any year divisible by 100 is
  a leap year only if it is also divisible by 400. Write a program which works out the
  leap years between two years given by the user. The program should list 10 leap
  years per line, with commas between each year listed and a full stop at the end, as
  in the following example input/output:</p>
  
  <pre><code>Enter start year: 1000
  Enter end year: 1200
  Here is a list of leap years between 1000 and 1200:
  1004, 1008, 1012, 1016, 1020, 1024, 1028, 1032, 1036, 1040,
  1044, 1048, 1052, 1056, 1060, 1064, 1068, 1072, 1076, 1080,
  1084, 1088, 1092, 1096, 1104, 1108, 1112, 1116, 1120, 1124,
  1128, 1132, 1136, 1140, 1144, 1148, 1152, 1156, 1160, 1164,
  1168, 1172, 1176, 1180, 1184, 1188, 1192, 1196, 1200.
  </code></pre>
  
  <p>Hints: the answer uses a for loop to work through all the years from the start year to the
  end year, an extra variable as a leap year counter, and various if and if-else statements
  inside the loop to check if the year is a leap year, if a comma is needed, and if a new line
  is needed.</p>