1.2.3 循环
来源:互联网 发布:好桌道类似软件 编辑:程序博客网 时间:2024/05/21 18:20
for i in range(0,100):
print(i)
print("item" + i) #如果在输出时添加“item”,则会报错,字符串不匹配
修改 字符串拼接
print("item {0}".format(i))
Update.
print("item {0},{1}".format(i,"hello python")
>>> print("item {0}{1}" . format(2333 , "hello python"))
item 2333hello python
>>> print("item {0},{1}" . format(2333 , "hello python"))
item 2333,hello python
>>> print("item {0} {1}" . format(2333 , "hello python"))
item 2333 hello python
cf : 三种字符串拼接是一样的
print( "%s" % ( "strings"))
print( "{0}" . format("strings")
print( "{name}" . format(name = "bob")
0 0
- 1.2.3 循环
- 3 循环
- 循环练习3
- 循环球和 3
- 循环与判断3
- C++3 循环
- 循环队列实验3
- while 循环3
- 循环(3)
- 9个循环3
- 自用基础3-循环
- 3个while循环
- 循环
- 循环
- 循环
- 循环
- 循环
- 循环
- 完全平方数
- 1.2.1 定义变量
- easyUI修饰的文本框绑定失去焦点事件
- UIButton设置图片不显示的问题
- 跳转到系统设置页(ios8及更高版本)
- 1.2.3 循环
- Swift闭包
- Android Studio Fragment问题与解决
- linux 进程(一)---基本概念
- java 泛型 E/T/K/V/N 代表的意义
- hdu 3158 Boring counting 后缀数组
- linux 进程(二) --- 进程的创建及相关api
- 数据库性能的6大指标
- python代码风格推荐