3操作列表 3.1 遍历整个列表 使用for循环 cars = ['bmw','audi','toyota','Jeep'] for i in cars: print(i) bmw audi toyota Jeep 3.1.1 在for循环中执行更多的操作 cars = ['bmw','audi','toyota','Jeep'] for i in cars: print(i + " was my first car" + '!' ) bmw was my first car! aud…
引言: 最近大半年都在学习python编程,在双十一的时候购买了<Python编程核心>,看到makeTextFile.py和readTextFile.py两个例子有点错误,所以在这里给修正一下! makeTextFile.py脚本: #!/usr/bin/env python #_*_coding:utf8_*_ 'makeTextFile.py -- create text file' import os ls = os.linesep #get filename while True:…