日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程语言 > python >内容正文

python

python取数组最后一个元素_Python Json。只获取json数组中的最后一个元素

發(fā)布時(shí)間:2023/12/19 python 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python取数组最后一个元素_Python Json。只获取json数组中的最后一个元素 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

我剛開(kāi)始嘗試python,現(xiàn)在我有點(diǎn)左右為難。在

我試圖從一個(gè)json文檔打印,而我只得到數(shù)組中的最后一個(gè)元素。在[{

"FullMeasure": "1/2 cup",

"FullWeight": "",

"IngredientGridHeaders": null,

"IngredientID": 1142,

"IngredientName": "frozen corn",

"IngredientStep": 10,

"LanguageId": 0,

"PostPreparation": ", thawed, drained",

"PrePreparation": "",

"QuantityNum": 0,

"QuantityText": "1/2",

"QuantityUnit": "cup",

"RecipeIngredientID": 6291555,

"TrialMeasure": "",

"TrialWeight": ""

},

{

"FullMeasure": "1/4 cup",

"FullWeight": "",

"IngredientGridHeaders": null,

"IngredientID": 1523,

"IngredientName": "red pepper",

"IngredientStep": 20,

"LanguageId": 0,

"PostPreparation": "s",

"PrePreparation": "chopped",

"QuantityNum": 0,

"QuantityText": "1/4",

"QuantityUnit": "cup",

"RecipeIngredientID": 6291554,

"TrialMeasure": "",

"TrialWeight": ""

},

{

"FullMeasure": "2 Tbsp.",

"FullWeight": "",

"IngredientGridHeaders": null,

"IngredientID": 20197,

"IngredientName": "chopped green chiles",

"IngredientStep": 30,

"LanguageId": 0,

"PostPreparation": ", drained",

"PrePreparation": "canned ",

"QuantityNum": 2,

"QuantityText": "2",

"QuantityUnit": "Tbsp.",

"RecipeIngredientID": 6291552,

"TrialMeasure": "",

"TrialWeight": ""

},

{

"FullMeasure": "",

"FullWeight": "",

"IngredientGridHeaders": null,

"IngredientID": 19682,

"IngredientName": "KRAFT DELI DELUXE Process American Cheese Slice",

"IngredientStep": 80,

"LanguageId": 0,

"PostPreparation": "s",

"PrePreparation": "",

"QuantityNum": 4,

"QuantityText": "4",

"QuantityUnit": "",

"RecipeIngredientID": 6291558,

"TrialMeasure": "",

"TrialWeight": ""

}

]

我想得到所有的ingredientID,所以我寫(xiě)了一段代碼來(lái)獲取ingredientID

^{pr2}$

當(dāng)我返回值時(shí),我得到{

"Ingreient ID": 19682

}

我試圖得到每種元素的成分ID,但我似乎搞不清楚。如有任何建議,我們將不勝感激。謝謝你

總結(jié)

以上是生活随笔為你收集整理的python取数组最后一个元素_Python Json。只获取json数组中的最后一个元素的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。