Usage demonstration of sleep function in Python

From , 3 Years ago, written in Python, viewed 214 times.
URL https://pastebin.vip/view/6a0724f1
  1. #------------------------------------------------------------------------------
  2. #           Name: sleep.py
  3. #         Author: Kevin Harris
  4. #  Last Modified: 02/13/04
  5. #    Description: This Python script demonstrates how to use the sleep()
  6. #                 function.
  7. #------------------------------------------------------------------------------
  8.  
  9. from time import sleep
  10.  
  11. print( "We'll start off by sleeping 5 seconds" )
  12.  
  13. sleep( 5 )
  14.  
  15. print( "Ok, time to wake up!" )
  16.  
  17. wait_time = int( input( "How much longer would you like to sleep? " ) )
  18.  
  19. while wait_time > 0:
  20.     print( "Ok, we'll sleep for " + str(wait_time) + " more seconds..." )
  21.     sleep( wait_time )
  22.     wait_time = int( input( "How much longer would you like to sleep? " ) )
  23.  
  24. print( "We're done!" )
  25.  
  26. #//python/8097

Reply to "Usage demonstration of sleep function in Python"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website