这是我的字典
{'www.pic2fly.com/Weather+Of+Bahawalpur.html': ['https://tse1.mm.bing.net/th?
id=OIP.RsEykDoK1xxg2zivHYW7WwEsC5&pid=Api'], 'panoramio.com/photo/84118355':
['https://tse2.mm.bing.net/th?id=OIP.1683LeSgJHoFhxX-tKhGSAEsDh&pid=Api'], 'nativepakistan.com/photos-of-bahawalpur': ['https://tse3.mm.bing.net/th?id=OIP.wS0pep46eEsGSSY39RNxLQEsDQ&pid=Api', 'https://tse2.mm.bing.net/th?id=OIP.Zn5zIzevX8HqUnwCyRZ3QwEsDJ&pid=Api', 'https://tse1.mm.bing.net/th?id=OIP.671-BIumri8_oRAQRLd-ggEsDJ&pid=Api', 'https://tse3.mm.bing.net/th?id=OIP.0dShzaFVWKBtTSxnOFHyaAEsDI&pid=Api', 'https://tse1.mm.bing.net/th?id=OIP.LXLVj2t-dawxlMcJp1GBTAEsDV&pid=Api', 'https://tse4.mm.bing.net/th?id=OIP.Z0-Y7RzbFM43N6YFNevsTQEsDL&pid=Api', 'https://tse1.mm.bing.net/th?id=OIP.AYjL8nxCNUE-HvEiifvqWQEsCc&pid=Api', 'https://tse4.mm.bing.net/th?id=OIP.Iy9NYKksUM3TSpgmOc0-JgDZEs&pid=Api', 'https://tse3.mm.bing.net/th?id=OIP.NHdCNr5g2CYn3L6wP77BygEsDg&pid=Api']}
使用for循环,我打印如下值
^{pr2}$我需要这个作为输出
www.pic2fly.com/Weather+Of+Bahawalpur.html
https://tse3.mm.bing.net/th?id=OIP.wS0pep46eEsGSSY39RNxLQEsDQ&pid=Api
panoramio.com/photo/84118355
https://tse2.mm.bing.net/th?id=OIP.Zn5zIzevX8HqUnwCyRZ3QwEsDJ&pid=Api
nativepakistan.com/photos-of-bahawalpur
https://tse1.mm.bing.net/th?id=OIP.671-BIumri8_oRAQRLd-ggEsDJ&pid=Api
https://tse3.mm.bing.net/th?id=OIP.0dShzaFVWKBtTSxnOFHyaAEsDI&pid=Api
https://tse1.mm.bing.net/th?id=OIP.LXLVj2t-dawxlMcJp1GBTAEsDV&pid=Api
....
我刚开始学字典请帮忙
好吧,所以如果你把你的字典叫做a,你可以:
如果您使用的是python2.X,则可以在打印时删除括号
您试图打印字典中的所有值,其中列出了值。我们的方法是:
my_dict[key]
处找到的列表相关问题 更多 >
编程相关推荐