cunchi4221的博客Python String comparison can be performed using equality (==) and comparison (<, >, !=, <=, >=) operators. There are no special methods to compare two strings. 可以使用相等(==)和比较(&...
weixin_39976251的博客' >>> mystring[4:len(mystring)-1] 'o World' >>> mystring[4:7] 'o W' >>> 或者,如果要打印字符串中的每三个字符,请使用以下代码:>>> def PrintThree(string): ... string = [string[i:i+3] for i in range(0, ...