I am facing the following problem;
Somewhere inside my script I have defined a function
def lookup(type, value):
doctors = {'doctor1':"Smith", 'doctor2':"Rogers"}
supervisors = {'super1': "Steve", 'super2': "Annie"}
print type['value']
I am calling this function from the end of my script like this:
myDoc = 'super1'
lookup('supervisors', myDoc)
However I get the following error:
TypeError: string indices must be integers, not str
Why is that happening and how may I fix it?
Thank you all in advance!