1.简单的循环
while count >0
print count, # 有逗号被程序表示做空格,且不换行
count-=1
while count < 10
print count
count +=1
output:
10 9 8 7 6 5 4 3 2 1 0
1
2
3
4
5
6
7
8
9
Press any key to continue . . .
2.命令行读写文件
>>> f = open("test.py")>>>
f.read() // read() 方法是默认读取所有,readline() 就是读一行
'\xef\xbb\xbffor each in [1,223,3,4,4,4,5,5,534,67]:\n\tprint each'
>>> f.close()