How to access tuple in django

How can I get a key that map a value in tuple ?

('game_number', '1')
('game_number', '2')
('game_number', '3')
('home_name', 'Chelsea')
('home_name', 'Man u')
('home_name', 'Man city')
('away_name', 'Arsenal')
('away_name', 'Liverpool')
('away_name', 'Juventus')
('status', '18:10PM')
('status', '20:00PM')
('status', '18:10PM')

I want something like this mylist.game_number or mylist[‘game_number’] that will return 1,2,3

One solution would be to use a list comprehension.

my_list = [
    ('game_number', '1'),
    ('game_number', '2'),
    ('game_number', '3'),
    ('home_name', 'Chelsea'),
    ('home_name', 'Man u'),
    ('home_name', 'Man city'),
    ('away_name', 'Arsenal'),
    ('away_name', 'Liverpool'),
    ('away_name', 'Juventus'),
    ('status', '18:10PM'),
    ('status', '20:00PM'),
    ('status', '18:10PM')

output = [a[1] for a in my_list if a[0] == "game_number"]

This doesn’t have anything to do with Django however. Just python related.

Thanks all, I stumbled to find a solution using getlist and zip…Please if there is a way I can improve more, let me know

        game_number ='game_number')
        home_name ='home_name')
        away_name ='away_name')
        status ='status')

        for (game_number, home_name, away_name, status) in zip(game_number, home_name, away_name, status):
            return {
                'game_number': game_number,
                'home_name': home_name,
                'away_name': away_name,
                'status': status,
                'home_result': None,
                'away_result': None,
                'result': 'LOADING',


{'game_number': '1', 'home_name': 'Chelsea', 'away_name': 'Arsenal', 'status': '18:10PM', 'home_result': None, 'away_result': None, 'result': 'LOADING'}
{'game_number': '2', 'home_name': 'Man u', 'away_name': 'Liverpool', 'status': '20:00PM', 'home_result': None, 'away_result': None, 'result': 'LOADING'}
{'game_number': '3', 'home_name': 'Man city', 'away_name': 'Juventus', 'status': '18:10PM', 'home_result': None, 'away_result': None, 'result': 'LOADING'}