My code is -
import json
f = open('AcceptanceCriteria.json')
data = json.load(f,strict=False)
for criteria in data['acceptanceCriteria']:
print(criteria)
Response getting is -
{'criteria': 'Assets are grouped at a Fabric level with each Fabric consisting of APICs and\nSwitches.'}
{'criteria': 'Cloud Network Software landing page shows the specified columns: Risk Level,\nFabric, Software Type, Current Release, Selected Release, Assets, and Suggestions.'}
how can I get rid of \n from the response
It looks like the content of each criteria entry is an object with a string valued property with key 'criteria', so the below should work fine:
I renamed the 'criteria' variable to make it more obvious it's an entry in an array. Updated to correct access syntax for string key in the dictionary structure, as pointed out by Nick in the comments