• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > python遍历 truple list dictionary的几种方法总结

python遍历 truple list dictionary的几种方法总结

作者:jingxian 字体:[增加 减小] 来源:互联网

jingxian 通过本文主要向大家介绍了truple,list dictionary,c list dictionary,c list todictionary,list 转dictionary等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

实例如下:

def TestDic1():
  dict2 ={'aa':222,11:222}
  for val in dict2:
    print val

def TestDic2():
  dict2 ={'aa':222,11:222}
  for (key,val) in dict2.items():
    print key,":",val   

def TestList1():
  list=[1,2,3,4,5,3,2,'ada','fs3']
  for i in range(len(list)):
    print list[i]

def TestDic3():
  dict2 ={'aa':222,11:222}
  print "###########iteritems#################"
  for k,v in dict2.iteritems():
    print "dict[%s]=" % k,v

def TestDic4():
  dict2 ={'aa':222,11:222}
  print "###########iterkeys,itervalues#######"
  for k,v in zip(dict2.iterkeys(),dict2.itervalues()):
    print "dict[%s]=" % k,v    

def TestList2():
  list=[1,2,3,4,5,3,2,'ada','fs3']
  for i in list:
    print i
</div>

以上这篇python遍历 truple list dictionary的几种方法总结就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

</div>

您可能想查找下面的文章:

  • python遍历 truple list dictionary的几种方法总结

相关文章

  • python实用代码片段收集贴
  • Python实现删除Android工程中的冗余字符串
  • 总结Python中逻辑运算符的使用
  • Python入门篇之列表和元组
  • 详解Python的Flask框架中生成SECRET_KEY密钥的方法
  • 将Python的Django框架与认证系统整合的方法
  • Python struct.unpack
  • 利用numpy+matplotlib绘图的基本操作教程
  • 对于Python中RawString的理解介绍
  • 双向RNN:bidirectional_dynamic_rnn()函数的使用详解

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • 总结Python编程中函数的使用要点
    • python中enumerate函数遍历元素用法分析
    • Python 错误和异常小结
    • python对json的相关操作实例详解
    • NumPy排序的实现
    • Python程序中的观察者模式结构编写示例
    • 介绍Python中的__future__模块
    • 使用Python实现博客上进行自动翻页
    • 在Mac OS系统上安装Python的Pillow库的教程
    • Python过滤列表用法实例分析

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有