Tuesday, October 14, 2014

Mucking around with python and time

Was a little bored today, so I wrote a random python countdown to muck around with time in python.

Using Python 3.4.2

#!/usr/bin/python
import time

YVal=5

print ("Hello World!")
print ("Get Ready for the count!\n\n")
for X in reversed(range(1,4)):
    print ("In", X)
    time.sleep( 1)

print ("\nChecking if Y is equal to", YVal)
for Y in  range(YVal+1):
    if Y != YVal:
        print ("It's not yet equal to", YVal)
    else:
        print ("\n\nNow Y is equal to!", Y, "\nExiting...")
        break
    print ("\nY is equal to", Y)
    time.sleep( 1 )