Skip to content

Instantly share code, notes, and snippets.

@prashanth-sams
Created July 29, 2020 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prashanth-sams/a7207b997a93fc4717f115fffcfc0ed3 to your computer and use it in GitHub Desktop.
Save prashanth-sams/a7207b997a93fc4717f115fffcfc0ed3 to your computer and use it in GitHub Desktop.
sample
self.json_data = {
'content': {
'suites': {
0: {
'name': None,
'status': None,
},
}
}
}
self.json_data['content']['suites'][0]['name'] = 'suite1'
self.json_data['content']['suites'][1]['name'] = 'suite1'
@prashanth-sams
Copy link
Author

Error: on executing self.json_data['content']['suites'][1]['name'] = 'suite2'

*** KeyError: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment