#import math module to enable splitting ints and decimal values:
import math
import datetime

#Set colors for fonts:
green = '\033[32m'
red = '\033[31m'
dColor = '\033[m'

#Print the welcome banner:
print("\033[32m")
print("/-------------------------------------\\")
print("|Tim's Wonderful Time Card Calculator!|")
print("\\-------------------------------------/")
print("\033[m")

#Query user for decimal formatted hours worked:
fridayCheck = input("Is it Friday (y/n)?:")
while fridayCheck != "y":
    print("This tool only works on Fridays, work some more and then come back.")
    fridayCheck = input("Is it Friday (y/n)?:")

arrivalTime = input("Phew.. What time did you arrive today? (ex: 9:00, AM is assumed): ")
timeWorked = float(input("How many hours have you already worked in ADP? (ex: 34.67): "))

#Verify that it's a calculation we can actually work with:
while timeWorked < 24 or timeWorked > 40:
    #clear screen:
    print(chr(27)+'[2j')
    print('\033c')
    print('\x1bc')

    print("Sorry, I can't help you.. You've worked too much already this week... or too little.")
    timeWorked = float(input("How many hours have you already worked in ADP? (ex: 34.67): "))

#Once we can work with it:
#split and then store arrival time using datetime module:
arrivalHours, arrivalMinutes = arrivalTime.split(":")
arrivalHours = int(arrivalHours)
arrivalMinutes = int(arrivalMinutes)
arrivalTime = datetime.datetime(2000, 1, 1, arrivalHours, arrivalMinutes, 0)

#clear screen:
print(chr(27)+'[2j')
print('\033c')
print('\x1bc')

#split decimal formatted hours worked into int holding hours and int holding minutes:
minutesWorked, hoursWorked = math.modf(timeWorked)

#Covert the stored decimal value of minutes to an int, and round up:
minutesWorked = math.ceil(minutesWorked * 60)

#Convert total time worked into minutes, then subtract from full 40hr week:
timeWorked = timeWorked * 60 
timeLeft = 2400 - timeWorked

#Split timeLeft into minutes/hours left and QC the minutes:
minutesLeft, hoursLeft = math.modf((timeLeft / 60))
if minutesWorked > 0:
	minutesLeft = 60 - minutesWorked
else:
	minutesLeft = 0
hoursLeft = int(hoursLeft)

#Start calculating the time the user can leave:
leftTime = datetime.datetime(2000, 1, 1, hoursLeft, minutesLeft, 0)
leaveTime = arrivalTime + datetime.timedelta(hours=hoursLeft,minutes=minutesLeft)
lTime = leaveTime.strftime("%I:%M %P")
leaveTime = format(leaveTime, '%H:%M')

#Give the user the computed results:
print ("You've worked %s%d hours and %d%s minutes so far this week."% (green, hoursWorked, minutesWorked, dColor))
print ("You still need to work %s%d hours and %d%s minutes to reach 40hrs." % (red, hoursLeft, minutesLeft, dColor))
print ("You can leave at: %s%s%s" % (green,lTime,dColor))
cc0f444ecf56c55326b6c87c6d3f8a3f3674ea97
<mask token>

<mask token>
print('\x1b[32m')
print('/-------------------------------------\\')
print("|Tim's Wonderful Time Card Calculator!|")
print('\\-------------------------------------/')
print('\x1b[m')
<mask token>
while fridayCheck != 'y':
    print('This tool only works on Fridays, work some more and then come back.'
        )
    fridayCheck = input('Is it Friday (y/n)?:')
<mask token>
while timeWorked < 24 or timeWorked > 40:
    print(chr(27) + '[2j')
    print('\x1bc')
    print('\x1bc')
    print(
        "Sorry, I can't help you.. You've worked too much already this week... or too little."
        )
    timeWorked = float(input(
        'How many hours have you already worked in ADP? (ex: 34.67): '))
<mask token>
print(chr(27) + '[2j')
print('\x1bc')
print('\x1bc')
<mask token>
if minutesWorked > 0:
    minutesLeft = 60 - minutesWorked
else:
    minutesLeft = 0
<mask token>
print("You've worked %s%d hours and %d%s minutes so far this week." % (
    green, hoursWorked, minutesWorked, dColor))
print('You still need to work %s%d hours and %d%s minutes to reach 40hrs.' %
    (red, hoursLeft, minutesLeft, dColor))
print('You can leave at: %s%s%s' % (green, lTime, dColor))

<mask token>
green = '\x1b[32m'
red = '\x1b[31m'
dColor = '\x1b[m'
print('\x1b[32m')
print('/-------------------------------------\\')
print("|Tim's Wonderful Time Card Calculator!|")
print('\\-------------------------------------/')
print('\x1b[m')
fridayCheck = input('Is it Friday (y/n)?:')
while fridayCheck != 'y':
    print('This tool only works on Fridays, work some more and then come back.'
        )
    fridayCheck = input('Is it Friday (y/n)?:')
arrivalTime = input(
    'Phew.. What time did you arrive today? (ex: 9:00, AM is assumed): ')
timeWorked = float(input(
    'How many hours have you already worked in ADP? (ex: 34.67): '))
while timeWorked < 24 or timeWorked > 40:
    print(chr(27) + '[2j')
    print('\x1bc')
    print('\x1bc')
    print(
        "Sorry, I can't help you.. You've worked too much already this week... or too little."
        )
    timeWorked = float(input(
        'How many hours have you already worked in ADP? (ex: 34.67): '))
arrivalHours, arrivalMinutes = arrivalTime.split(':')
arrivalHours = int(arrivalHours)
arrivalMinutes = int(arrivalMinutes)
arrivalTime = datetime.datetime(2000, 1, 1, arrivalHours, arrivalMinutes, 0)
print(chr(27) + '[2j')
print('\x1bc')
print('\x1bc')
minutesWorked, hoursWorked = math.modf(timeWorked)
minutesWorked = math.ceil(minutesWorked * 60)
timeWorked = timeWorked * 60
timeLeft = 2400 - timeWorked
minutesLeft, hoursLeft = math.modf(timeLeft / 60)
if minutesWorked > 0:
    minutesLeft = 60 - minutesWorked
else:
    minutesLeft = 0
hoursLeft = int(hoursLeft)
leftTime = datetime.datetime(2000, 1, 1, hoursLeft, minutesLeft, 0)
leaveTime = arrivalTime + datetime.timedelta(hours=hoursLeft, minutes=
    minutesLeft)
lTime = leaveTime.strftime('%I:%M %P')
leaveTime = format(leaveTime, '%H:%M')
print("You've worked %s%d hours and %d%s minutes so far this week." % (
    green, hoursWorked, minutesWorked, dColor))
print('You still need to work %s%d hours and %d%s minutes to reach 40hrs.' %
    (red, hoursLeft, minutesLeft, dColor))
print('You can leave at: %s%s%s' % (green, lTime, dColor))

import math
import datetime
green = '\x1b[32m'
red = '\x1b[31m'
dColor = '\x1b[m'
print('\x1b[32m')
print('/-------------------------------------\\')
print("|Tim's Wonderful Time Card Calculator!|")
print('\\-------------------------------------/')
print('\x1b[m')
fridayCheck = input('Is it Friday (y/n)?:')
while fridayCheck != 'y':
    print('This tool only works on Fridays, work some more and then come back.'
        )
    fridayCheck = input('Is it Friday (y/n)?:')
arrivalTime = input(
    'Phew.. What time did you arrive today? (ex: 9:00, AM is assumed): ')
timeWorked = float(input(
    'How many hours have you already worked in ADP? (ex: 34.67): '))
while timeWorked < 24 or timeWorked > 40:
    print(chr(27) + '[2j')
    print('\x1bc')
    print('\x1bc')
    print(
        "Sorry, I can't help you.. You've worked too much already this week... or too little."
        )
    timeWorked = float(input(
        'How many hours have you already worked in ADP? (ex: 34.67): '))
arrivalHours, arrivalMinutes = arrivalTime.split(':')
arrivalHours = int(arrivalHours)
arrivalMinutes = int(arrivalMinutes)
arrivalTime = datetime.datetime(2000, 1, 1, arrivalHours, arrivalMinutes, 0)
print(chr(27) + '[2j')
print('\x1bc')
print('\x1bc')
minutesWorked, hoursWorked = math.modf(timeWorked)
minutesWorked = math.ceil(minutesWorked * 60)
timeWorked = timeWorked * 60
timeLeft = 2400 - timeWorked
minutesLeft, hoursLeft = math.modf(timeLeft / 60)
if minutesWorked > 0:
    minutesLeft = 60 - minutesWorked
else:
    minutesLeft = 0
hoursLeft = int(hoursLeft)
leftTime = datetime.datetime(2000, 1, 1, hoursLeft, minutesLeft, 0)
leaveTime = arrivalTime + datetime.timedelta(hours=hoursLeft, minutes=
    minutesLeft)
lTime = leaveTime.strftime('%I:%M %P')
leaveTime = format(leaveTime, '%H:%M')
print("You've worked %s%d hours and %d%s minutes so far this week." % (
    green, hoursWorked, minutesWorked, dColor))
print('You still need to work %s%d hours and %d%s minutes to reach 40hrs.' %
    (red, hoursLeft, minutesLeft, dColor))
print('You can leave at: %s%s%s' % (green, lTime, dColor))

#import math module to enable splitting ints and decimal values:
import math
import datetime

#Set colors for fonts:
green = '\033[32m'
red = '\033[31m'
dColor = '\033[m'

#Print the welcome banner:
print("\033[32m")
print("/-------------------------------------\\")
print("|Tim's Wonderful Time Card Calculator!|")
print("\\-------------------------------------/")
print("\033[m")

#Query user for decimal formatted hours worked:
fridayCheck = input("Is it Friday (y/n)?:")
while fridayCheck != "y":
    print("This tool only works on Fridays, work some more and then come back.")
    fridayCheck = input("Is it Friday (y/n)?:")

arrivalTime = input("Phew.. What time did you arrive today? (ex: 9:00, AM is assumed): ")
timeWorked = float(input("How many hours have you already worked in ADP? (ex: 34.67): "))

#Verify that it's a calculation we can actually work with:
while timeWorked < 24 or timeWorked > 40:
    #clear screen:
    print(chr(27)+'[2j')
    print('\033c')
    print('\x1bc')

    print("Sorry, I can't help you.. You've worked too much already this week... or too little.")
    timeWorked = float(input("How many hours have you already worked in ADP? (ex: 34.67): "))

#Once we can work with it:
#split and then store arrival time using datetime module:
arrivalHours, arrivalMinutes = arrivalTime.split(":")
arrivalHours = int(arrivalHours)
arrivalMinutes = int(arrivalMinutes)
arrivalTime = datetime.datetime(2000, 1, 1, arrivalHours, arrivalMinutes, 0)

#clear screen:
print(chr(27)+'[2j')
print('\033c')
print('\x1bc')

#split decimal formatted hours worked into int holding hours and int holding minutes:
minutesWorked, hoursWorked = math.modf(timeWorked)

#Covert the stored decimal value of minutes to an int, and round up:
minutesWorked = math.ceil(minutesWorked * 60)

#Convert total time worked into minutes, then subtract from full 40hr week:
timeWorked = timeWorked * 60 
timeLeft = 2400 - timeWorked

#Split timeLeft into minutes/hours left and QC the minutes:
minutesLeft, hoursLeft = math.modf((timeLeft / 60))
if minutesWorked > 0:
	minutesLeft = 60 - minutesWorked
else:
	minutesLeft = 0
hoursLeft = int(hoursLeft)

#Start calculating the time the user can leave:
leftTime = datetime.datetime(2000, 1, 1, hoursLeft, minutesLeft, 0)
leaveTime = arrivalTime + datetime.timedelta(hours=hoursLeft,minutes=minutesLeft)
lTime = leaveTime.strftime("%I:%M %P")
leaveTime = format(leaveTime, '%H:%M')

#Give the user the computed results:
print ("You've worked %s%d hours and %d%s minutes so far this week."% (green, hoursWorked, minutesWorked, dColor))
print ("You still need to work %s%d hours and %d%s minutes to reach 40hrs." % (red, hoursLeft, minutesLeft, dColor))
print ("You can leave at: %s%s%s" % (green,lTime,dColor))