Example #1
0
def main():
    age = None
    try:
        age = int(sys.argv[1])
    except ValueError:
        print("ERROR: Please enter an integer")
        return

    if age < 0:
        print("ERROR: Negative ages are not allowed")
        return
    else:
        bday = BirthdayDate(settings.BIRTHDAY)
        future_date = bday.get_future_date(age)
        weekday = bday.get_birthday_weekday(age)
        message = "I will turn {} on {}, {}".format(age, weekday, future_date)
        print(message)
Example #2
0
def main():
    age = sys.argv[1]
    try:
        age = int(age)
    except ValueError:
        print("ERROR: Please provide an integer")
        return

    if age < 0:
        print("ERROR: Negative ages are not possible")
        return
    if age >= 0:
        bdate = BirthdayDate(settings.BIRTHDAY)
        future_date = bdate.get_future_date(age)
        weekday = bdate.get_birthday_weekday(age)
        message = "You will turn {} on {}, {}".format(age, weekday,
                                                      future_date)
        print(message)
Example #3
0
def main():
    age = sys.argv[1]
    try:
        age = int(age)
    except ValueError:
        print("ERROR: Please provide an integer")
        return

    if age < 0:
        print("ERROR: Negative ages are not possible")
        return
    if age >= 0:
        bdate = BirthdayDate(settings.BIRTHDAY)
        future_date = bdate.get_future_date(age)
        weekday = bdate.get_birthday_weekday(age)
        message = "You will turn {} on {}, {}".format(
            age, weekday, future_date)
        print(message)