07 2017 档案
摘要:a1 = {'Yuan': 30000, 'Alex': 100000, 'Egon': 50000, 'Rain': 90} #定义字典 f = open("test.txt","w+",encoding="UTF-8") #打开文件 for key in a1: #循环遍历字典 a2 = (key,str(a1[key])) #...
阅读全文
摘要:Python zip 函数。 zip函数接受任意多个(包括0个和1个)序列作为参数
阅读全文
摘要:文件内容如下: 现在看如何处理并转成列表! 输出结果如下:
阅读全文
摘要:定义字典 dic = {'a':"hello",'b':"how",'c':"you"}方法一:for key in dic: print key,dic[key] print key + str(dic[key])结果: a hello ahello c you cyou b how bhow细节
阅读全文

浙公网安备 33010602011771号