Python语句,s=“hello world”;print x.endswith('o',0,5)的输出结果为什么是TRUE要算第六个字母吗
首先,x是哪来的,是s吧s.endswith('o',0,5)等价于s[0:5].endswith('o')这回知道了吧还不知道你把s[0:5]打印出来看