python循环

来源:互联网 发布:网络诈骗八千 编辑:程序博客网 时间:2024/06/04 18:50

python循环

python循环


形式:

for xx in range(xx,xx):

  括号中包括左不包括右,一个左闭右开的区间。

python循环不支持字符串拼接

但是可以设置format

format可以传多个参数进来

其中,{}中的是占位符

for i in range(0,100):    print ("Item {0},{1}".format(i,"HelloPython"))