Error while accessing dictionary in python : I have a dictionary named json_dict given below. 

I need to access the element ==> json_dict['OptionSettings'][3]['Value'].

I need to access the element like 

print(json_dict[param]). 



When I giving param like 

param="['OptionSettings'][3]['Value']"  OR


param="'OptionSettings'][3]['Value'"

I am getting below error 

KeyError: "['OptionSettings'][3]['Value']" OR

KeyError: "'OptionSettings'][3]['Value'"

I tried below thing also but it just print the string

str1="json_dict"

print(str1+param)

    {
            "ApplicationName": "Test",
            "EnvironmentName": "ABC-Nodejs",
            "CNAMEPrefix": "ABC-Neptune",
            "SolutionStackName": "64bit Amazon Linux 2016.03 v2.1.1 running Node.js",
            "OptionSettings": [
                               {
                                "Namespace": "aws:ec2:vpc",
                                "OptionName": "AssociatePublicIpAddress",
                                "Value": "true"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:environment",
                                "OptionName": "EnvironmentType",
                                "Value": "LoadBalanced"
                                },
                               {
                                "Namespace": "aws:ec2:vpc",
                                "OptionName": "Subnets",
                                "Value": "param1"
                                },
                               {
                                "Namespace": "aws:autoscaling:launchconfiguration",
                                "OptionName": "SecurityGroups",
                                "Value": "param2"
                                },
                               {
                                "Namespace": "aws:autoscaling:asg",
                                "OptionName": "MinSize",
                                "Value": "1"
                                },
                               {
                                "Namespace": "aws:autoscaling:asg",
                                "OptionName": "MaxSize",
                                "Value": "4"
                                },
                               {
                                "Namespace": "aws:autoscaling:asg",
                                "OptionName": "Availability Zones",
                                "Value": "Any"
                                },
                               {
                                "Namespace": "aws:autoscaling:asg",
                                "OptionName": "Cooldown",
                                "Value": "360"
                                },
                               {
                                "Namespace": "aws:autoscaling:launchconfiguration",
                                "OptionName": "IamInstanceProfile",
                                "Value": "NepRole"
                                },
                               {
                                "Namespace": "aws:autoscaling:launchconfiguration",
                                "OptionName": "MonitoringInterval",
                                "Value": "5 minutes"
                                },
                               {
                                "Namespace": "aws:autoscaling:launchconfiguration",
                                "OptionName": "RootVolumeType",
                                "Value": "gp2"
                                },
                               {
                                "Namespace": "aws:autoscaling:launchconfiguration",
                                "OptionName": "RootVolumeSize",
                                "Value": "10"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:sns:topics",
                                "OptionName": "Notification Endpoint",
                                "Value": "sunil.kumar2@pb.com"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:hostmanager",
                                "OptionName": "LogPublicationControl",
                                "Value": "false"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:command",
                                "OptionName": "DeploymentPolicy",
                                "Value": "Rolling"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:command",
                                "OptionName": "BatchSizeType",
                                "Value": "Percentage"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:command",
                                "OptionName": "BatchSize",
                                "Value": "100"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:command",
                                "OptionName": "HealthCheckSuccessThreshold",
                                "Value": "Ok"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:command",
                                "OptionName": "IgnoreHealthCheck",
                                "Value": "false"
                                },
                               {
                                "Namespace": "aws:elasticbeanstalk:command",
                                "OptionName": "Timeout",
                                "Value": "600"
                                },
                               {
                                "Namespace": "aws:autoscaling:updatepolicy:rollingupdate",
                                "OptionName": "RollingUpdateEnabled",
                                "Value": "false"
                                },
                               {
                                "Namespace": "aws:ec2:vpc",
                                "OptionName": "ELBSubnets",
                                "Value": "param3"
                                },
                               {
                                "Namespace": "aws:elb:loadbalancer",
                                "OptionName": "SecurityGroups",
                                "Value": "param4"
                                },
                               {
                                "Namespace": "aws:elb:loadbalancer",
                                "OptionName": "ManagedSecurityGroup",
                                "Value": "param4"
                                }
                               ]
    
    }