标签:-- cells 结果 pre jupyter python cell sub 切片
切片类似于 substring ,比 substring 好用
a=[5,56,5,6,85,99,2,4,5,5,7]
print (a[:-5],a[-5:],a[3:5],a[:2])
输出结果:
[5, 56, 5, 6, 85, 99] [2, 4, 5, 5, 7] [6, 85] [5, 56]
print ("士大夫的范德萨的"[:2])
士大
标签:-- cells 结果 pre jupyter python cell sub 切片
原文地址:https://www.cnblogs.com/hisuper/p/9803366.html