【发布时间】:2023-03-16 07:40:01
【问题描述】:
如何将 JSON 下面的 terms 的值以相反的顺序提取到列表中。在此示例中,我希望输出为 ["Auto Ontology","hdfc bank","giftplus card"]。
{
"faqs": [
{
"question": "Can the value of the HDFC Bank Giftplus card be topped up?",
"alternateQuestions": [
],
"terms": [
"giftplus card",
"hdfc bank",
"Auto Ontology"
],
"tags": [
],
"refId": "7aea18a1-32c8-5af4-8d77-da31f9c7ff26",
"responseType": "message",
"answer": [
{
"text": "Gifting we believe is special to the occasion and hence you cannot reload this card. Every occasion is a new occasion and deserves a new card.",
"type": "basic",
"channel": "default"
}
],
"alternateAnswers": [
]
},**strong text**
【问题讨论】:
-
到目前为止您尝试了哪些方法,您遇到了哪些具体问题? SO 不是代码编写服务。
-
打印(some_json['faqs'][0]['terms'][::-1])
标签: json python-3.x