#
# Author: Benjamin Dicken
# Description:
#    This program converts either years, weeks, or days into hours.
#    It also does some basic input validation

unit = input("What unit to use? ")
unit_quantity = input("How many " + unit + "? ")

if (unit_quantity.isnumeric() == False):
    print("Sorry, I can't compute that.")
else:
    hours = 0
    if (unit == "years"):
        hours = int(unit_quantity) * 365 * 24
        print("There are " + str(hours) + " hours in " + str(unit_quantity) + " " + unit)
    elif (unit == "months"):
        hours = int(unit_quantity) * 30 * 24
        print("There are " + str(hours) + " hours in " + str(unit_quantity) + " " + unit)
    elif (unit == "weeks"):
        hours = int(unit_quantity) * 7 * 24
        print("There are " + str(hours) + " hours in " + str(unit_quantity) + " " + unit)
    elif (unit == "days"):
        hours = int(unit_quantity) * 24
        print("There are " + str(hours) + " hours in " + str(unit_quantity) + " " + unit)
    else:
        print("Sorry, invalid unit.")

