Python中2.7.14中字符串str[:]截取操作中下标重复或溢出

正常情况下,访问下标超出字符串长度-1的元素时会报错,指出索引越界异常

当用str[a:b]截取字符串时,如果a=b或者a>b时均不会报错,但不会返回任何东西

猜你喜欢

转载自blog.csdn.net/qiubingcsdn/article/details/82388377