CavuisLim
2017-09-04 10:19关于python索引的问题
具体代码如下:
age = 20
name = 'Swaroop'
print('{0} was {1} years old when he wrote this book'.format(name, age))
print('Why is {0} playing with that python?'.format(name))
输出:
$ python str_format.py Swaroop was 20 years old when he wrote this book Why is Swaroop playing with that python?
我想问一下python的索引从0开始 那么0不应该是age 1不应该是name吗?
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- python itchat的使用问题
- python
- 2个回答
- python enumerate函数问题
- python
- list
- 1个回答
- 求教关于python代码编写
- python
- 1个回答
- 根据数组的索引显示不同的HTML元素
- python
- html
- arrays
- php
- 1个回答
- python如何删除一个excel文件第5列
- python
- 2个回答
换一换