qq_26097991
CavuisLim
2017-09-04 10:19

关于python索引的问题

  • 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条回答

为你推荐

换一换