Lecture Notes on 21 Sep 2012 # Write a boolean expression that evaluates to True if y is a leap year (y % 400 == 0) or ((y % 100 != 0) and (y % 4 == 0)) # Loops while (cond): # do this while (True): # do this # Keep prompting the user till he enters a positive number num = eval (input ("Enter a positive number: ")) while ( num < 0 ): num = eval (input ("Enter a positive number: ")) # Keep prompting the user to enter a valid month month = eval (input ("Enter the month: ")) while ((month < 1) or (month > 12)): month = eval (input ("Enter the month: "))