0 python
我有一个列表,list = ['foo','bar']现在我想从每个项目创建一个字符串.
list = ['foo','bar']
每个字符串都被命名为项目,并具有项目的值
foo ='foo'bar ='bar'
谢谢大家,我会用dict代替
Ign*_*ams 9
不要那样做.请改用dict.
strings = dict((x, x) for x in L)
归档时间:
16 年,1 月 前
查看次数:
326 次
最近记录: