def team_info(team, purpose):

    """
    Function that displays and returns the information about the tean.

    Params: 
        team(dict) contains all information about requested team
        purpose(string) like "console"

    Example of team stats displayed:
        ARSENAL FC

            FOUNDED: 1886
            VENUE: Emirates Stadium
            CLUB COLORS: Red / White

            ACTIVE COMPETITIONS:
            Premier League
            UEFA Europa League
            FA Cup

            ADDRESS: 75 Drayton Park London N5 1BU
            PHONE: +44 (020) 76195003
            WEBSITE: http://www.arsenal.com
            EMAIL: info@arsenal.co.uk
    """


    if purpose == "console":
        print("\n" + team["name"].upper() + "\n")
        print("\t" + "FOUNDED: " + str(team["founded"]))
        print("\t" + "VENUE: " + team["venue"])
        print("\t" + "CLUB COLORS: " + team["clubColors"] + "\n")
        print("\t" + "ACTIVE COMPETITIONS:")
        for competition in team["activeCompetitions"]:
            print("\t   " + competition["name"])
        print("\n\t" + "ADDRESS: " + team["address"])
        if team["phone"] != None:
            print("\t" + "PHONE: " + team["phone"])
        print("\t" + "WEBSITE: " + team["website"])
        if team["email"] != None:
            print("\t" + "EMAIL: " + team["email"])
        print()
    elif purpose == "email":
        team_contacts = [team["address"], team["phone"], team["website"]]
        if team["email"] != None:
            team_contacts.append(team["email"])
        return team_contacts