-
Notifications
You must be signed in to change notification settings - Fork 0
/
nfl_challenge.py
42 lines (37 loc) · 1.87 KB
/
nfl_challenge.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
Prompt the user for either an NFL conference and division or the name of an NFL team.
Based on the response, return either a list of teams in that division or the name of the team's division.
>>> NFL_TEAMS = {'foo':{'bar':['baz']}}
>>> get_teams_by_conference_and_division(NFL_TEAMS, 'foo', 'bar')
['baz']
>>> get_conference_and_division_by_team_name(NFL_TEAMS, 'baz')
('foo', 'bar')
"""
def get_teams_by_conference_and_division(teams, conference, division):
pass
def get_conference_and_division_by_team_name(teams, team_name):
pass
def main(teams):
"""Prompt for user input, get a result from the data, print a nicely formatted answer"""
user_input1 = input('Enter the name of either a conference (AFC or NFC) or team: ').upper()
if user_input1 == 'AFC':
user_input2 = input('Which division?: ').capitalize()
print(NFL_TEAMS[user_input1][user_input2])
elif user_input1 == "NFC":
user_input2 = input('Which division?: ').capitalize()
print(NFL_TEAMS[user_input1][user_input2])
NFL_TEAMS = {
'AFC': {
'East': ['Buffalo Bills', 'Miami Dolphins', 'New England Patriots', 'New York Jets'],
'North': ['Baltimore Ravens', 'Cincinnati Bengals', 'Cleveland Browns', 'Pittsburgh Steelers'],
'South': ['Houston Texans', 'Indianapolis Colts', 'Jacksonville Jaguars', 'Tennessee Titans'],
'West': ['Denver Broncos', 'Kansas City Chiefs', 'Oakland Raiders', 'San Diego Chargers']
},
'NFC': {
'East': ['Dallas Cowboys', 'New York Giants', 'Philadelphia Eagles', 'Washington Redskins'],
'North': ['Chicago Bears', 'Detroit Lions', 'Green Bay Packers', 'Minnesota Vikings'],
'South': ['Atlanta Falcons', 'Carolina Panthers', 'New Orleans Saints', 'Tampa Bay Buccaneers'],
'West': ['Arizona Cardinals', 'Los Angeles Rams', 'San Francisco 49ers', 'Seattle Seahawks']
}
}
main(NFL_TEAMS)