def foo(): while timeRemaining(3): #if it gets in here it does everything in #the indented part before checking # timeRemaining again print "Hi" wait (2) print "Bye" foo()