I am wondering how to print two lists of the same size next to each other.
I have got these lists from a nested dict.
Here are the lists:
[
[
"Chelsea",
"Liverpool",
"ManCity",
"Arsenal",
"Spurs",
"ManU",
"Southampton",
"West Bromwich",
"Everton",
"Bournemouth",
"Stoke",
"Watford",
"West Ham",
"Middlesbrough",
"Foxes",
"Burnley",
"Crystal",
"Sunderland",
"Swans",
"Hull"
],
[
43,
37,
36,
34,
33,
30,
24,
23,
23,
21,
21,
21,
19,
18,
17,
17,
15,
14,
12,
12
]
]
Essentially, I want the list to be:
Chelsea: 44 Liverpool:37
etc...
Here is my python code:
@app.route('/League Standing', methods=['GET','POST'])
def show_league():
text = request.form['league']
connection = httplib.HTTPConnection('api.football-data.org')
headers = {'X-Auth-Token': 'key', 'X-Response-Control': 'minified'}
connection.request('GET', '/v1/competitions/'+text+'/leagueTable', None, headers)
response = json.loads(connection.getresponse().read().decode())
teamnames = [r['team'] for r in response['standing']]
points = [r['points'] for r in response['standing']]
for teamname, point in zip(teamnames, points):
print('{}: {}'.format(teamname, point))
I have tried formatting using %, but am not getting anything!