Python小白求教,怎样从这个列表中提取元素

 

result_win_loss= swapAPI.get_order_algos(instrument_id='ETH-USD-SWAP', order_type='5', status='',
                                 algo_id=result_algo_id, before='', after='', limit='')
result_win_loss_text=json.dumps(result_win_loss)
result_win_loss_info=json.loads(result_win_loss_text)
trigger_side=result_win_loss_info["orderStrategyVOS"]["trigger_side"]
print(trigger_side)

 

result_win_loss_info内容为以下列表内容:

 

{'orderStrategyVOS': [{'algo_id': '706843658788966400', 'contract_val': '10.0000', 'created_at': '2021-02-25T02:31:10.386Z', 'instrument_id': '', 'last_fill_px': '', 'leverage': '75.00', 'margin_for_unfilled': '0.0000', 'modifyTime': '', 'multiply': '1', 'order_id': '', 'order_side': '3', 'order_type': '5', 'real_amount': '', 'real_price': '', 'size': '1.0000', 'sl_price': '0.00', 'sl_trigger_price': '1632.48', 'sl_trigger_type': '2', 'status': '1', 'timestamp': '2021-02-25T02:31:10.386Z', 'tp_price': '0.00', 'tp_trigger_price': '1629.22', 'tp_trigger_type': '2', 'trigger_side': '', 'type': '4', 'unitAmount': '10.0000'}]}
 

 

trigger_side 这个参数提取错误,请问怎样才能正确提取,谢谢

trigger_side=result_win_loss_info["orderStrategyVOS"][0]["trigger_side"]

字典用键,字典是尖括号;列表和元组用角标提取,列表是方括号,元组是圆括号,也可以用切片提取。