I am creating a class and setting some properties. And I am referencing dictionary as a class object. But not able to access the second element of the object.
I tried to google the problem but it does not specify the cause of my problem.
data = {
'a': {
'vsdf': 'asfas',
'nfgn': 'aser',
'aser': 'rtydf'
},
'b': ['ndfg', 'ndf', 'safd']
}
My class looks something like this:
def __init__(self, meta):
self.meta = meta
and when i create the object of this class like this:
request = Request(data)
and try to print the request['b'] it shows the error "'Request' object is not subscriptable"
Actual result should be like : ['', '', '']
but it shows: 'Request' object is not subscriptable