python计算机二级考试常用语法(上)

#字符串的调出一个位置的元素,切片操作

print ("字符串调用算法"[1])#第二个位置
print ("字符串调用算法"[1:2])#第一个位置
print ("字符串调用方法"[1:4:2])#第二个位置到第三个位置
View Code

 

posted on 2019-03-20 22:02  盛世孤舟  阅读(185)  评论(0)    收藏  举报

导航