2024-04-25 05:41:49 发布
网友
来自python tutorial:
Degenerate slice indices are handled gracefully: an index that is too large is replaced by the string size, an upper bound smaller than the lower bound returns an empty string.
所以使用x[:100]是安全的。
x[:100]
print my_string[0:100]
简单:
print mystring[:100]
来自python tutorial:
所以使用
x[:100]
是安全的。简单:
相关问题 更多 >
编程相关推荐