'I am having trouble making python dictionary or list [closed]

I am very new to python and have a script that i wrote in PowerShell that I would like to recreate in python.

in powershell i have created a hashtable:

   $epBody = @{
                    "escalation_policy"   = @{
                        "type"               =   "escalation_policy"
                        "name"               =   $epName
                        "escalation_rules"   = @(
                            @{
                                "escalation_delay_in_minutes" = 30
                                "targets"                     = @(
                                    @{
                                        "id"    = $userid
                                        "type"  = "user_reference"
                                    }
                                )
                            }
                        ) 
                    }
                }

And trying to figure out the best way to write this in python.

this is what i have (which i know is wrong!):

ep_payload = {
                "escalation_policy": {
                        "type": "escalation_policy",
                        "name": epName,
                        "escalation_rules": [
                            {
                                "escalation_delay_in_minutes": 30,
                                "targets": [
                                    {
                                        "id": userid
                                        "type": "user_reference"
                                    }
                        ]
                            }
                        ] 
                    }
                }

I just cannot figure out the correct syntax for this one

cheers,



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source