python内建函数及属性

来源:互联网 发布:linux 创建网络接口 编辑:程序博客网 时间:2024/06/06 15:45

range() : 生成列表

  • 与len()一起用于字符串索引
  • 用做列表解析
foo='abc'for i in range(len(foo)):    print foo[i] ##输出为 a b c
0 0
原创粉丝点击