error list indices must be integers or slices, not str in flask

Solution
data = [{'q':'question text 1', 'ans':'a1', 'idsh':101}, ...]
if request.args.get('ans') == data[request.args.get('idsh')]: