python 3.1学习

我学完3.1后所获得的东西
列表索引
从0开始,而不是从一开始
有负索引,访问最后一个,通常将索引指为-1



names=['one','two','three','four']
print(names[1].title())
message = " i like "+ names[2].title() + " the most" + "."
print(message)

print(names[-1])


Two
 i like Three the most.
four
posted @ 2019-08-27 20:50  喵先生47  阅读(462)  评论(1编辑  收藏  举报