import calendar


def dayofweek(day, month, year, formatresult=True):
    """

    Get the day of the week for a specific day

    :type day: integer
    :param day: The day to include in the search

    :type month: integer
    :param month: The month to include in the search

    :type year: integer
    :param year: The year to include in the search

    :type formatresult: boolean
    :param formatresult: Whether or not to format the result. A formatted date would look like: "Monday". A non formatted date would look like: 1.

    """
    if formatresult is False:
        return calendar.weekday(year, month, day) + 1
    days = {
        0: 'Monday',
        1: "Tuesday",
        2: "Wednesday",
        3: "Thursday",
        4: "Friday",
        5: "Saturday",
        6: "Sunday"
    }
    return days[calendar.weekday(year, month, day)]