Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

create dictionary from a nested list

my_dict= 'mc': [[{'id': '1.185662381',
        'marketDefinition': {'bspMarket': False,
         'turnInPlayEnabled': True,
         'persistenceEnabled': True,
         'marketBaseRate': 5.0,
         'eventId': '30729399',
         'eventTypeId': '1',
         'numberOfWinners': 1,
         'bettingType': 'ODDS'}],
    [{'id': '1.185662380',
        'marketDefinition': {'bspMarket': True,
         'turnInPlayEnabled': False,
         'persistenceEnabled': True,
         'marketBaseRate': 5.0,
         'eventId': '30729399',
         'eventTypeId': '1',
         'numberOfWinners': 1,
         'bettingType': 'ODDS'}]]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #create #dictionary #nested #list
ADD COMMENT
Topic
Name
4+8 =