1
基本上,我有以下形式的字典:迭代通過列表的Python列表,並創建一個新的列表
'the trip':('The Trip','www.SearchHero.com',"See sponsored listings for 'The Trip.' Click here!",0.1,'The Trip','3809466'),
'post office':('Post Office','www.SearchHero.com',"See sponsored listings for 'Post Office.' Click here!",0.1,'Post Office','5803938'),
'balanced diets':('Last Minute Deals','www.SearchHero.com',"See sponsored listings for 'Last Minute Deals.' Click here!",0.1,'Last Minute Deals','1118375')
我要輸出形式的列表:
{'.1, 3809466', '.1, 5803938', '.1, '1118375'}
我是Python的新手,但在Ruby中我知道我會使用map函數。 python中的等價物是什麼?在此先感謝
您在某處丟失了括號嗎? – skline
在答案中已修復,謝謝! –