dekyos

Odd or Even Practice Exercise

Apr 10th, 2017
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. """
  3. @_Author: MadMerlyn
  4. Odd Example Program
  5. """
  6.  
  7. from datetime import datetime
  8. import time
  9. #generate a list of odd numbers from 1 to 59
  10. odds = list(range(1,60,2))
  11. #loop once per minute 5 times
  12. for i in range(5):
  13.     right_this_minute = datetime.today().minute
  14.     if right_this_minute in odds:
  15.         print("This minute seems a little odd")
  16.     else:
  17.         print("Not an odd minute.")
  18.     time.sleep(60)
Advertisement
Add Comment
Please, Sign In to add comment