Reputation: 91
This is the response received from third party API
response = [{ print = True },{print = False}]
Now if I access the "print" attribute of that response, it give me with syntax error
for res in response:
print res.print
SyntaxError('invalid syntax', '/home/suman/workspace/kioskinterface/apis/igt.py', 104, 38, '
print ticket.print\n')
The problem must be because of the reserved word. Is there any way around to access "print" attribute from the response.
Upvotes: 3
Views: 190