title: Trying to Figure out how to properly use a while loop in Python 3.3.0
body: <p>I am a bonafied noob at Python and I am writing a program that outputs whether a given date is a valid calendar date or not. I'm sure that there is much more elegant way to do it. </p>
  
  <p>At this point I'm trying to figure out how I can add a variable to create a while loop that will take care of the date if it is either a leap year or not a leap year. All suggestions are quite welcome though.</p>
  
  <p>I've put the problem areas of my code attempt inside &lt;>. Here is the code I have so far:</p>
  
  <pre><code>def main():
  print("This program tests the validity of a given date")
  
  date = (input("Please enter a date (mm/dd/yyyy): "))
  month, day, year = date.split("/")
  month = int(month)
  day = int(day)
  year = int(year)
  Mylist31 = [1, 3, 5, 7, 8, 10, 12]
  Mylist30 = [4, 6, 9, 11]
  
  #Calculates whether input year is a leap year or not
  if year &gt;= 100 and year % 4 == 0 and year % 400 == 0:
      &lt;it is a leap year&gt;
  elif year &gt;= 0 and year &lt;100 and year % 4 == 0:
      &lt;it is a leap year&gt;
  else: 
      &lt;it is not leapyear&gt;
  
  
  while &lt;it is a leapyear&gt;:
      if month in Mylist31 and day in range(1, 32):
          print("Valid date")
      elif month in Mylist30 and day in range(1,31):
          print("Valid date")
      elif month == 2 and day in range(1,30):
          print("Valid date")
      else:
          print("Not a Valid date")  
  while &lt;it is not a leapyear&gt;:
  etc...
  </code></pre>
  
  <p>main()</p>