str.endswith()

>>> s = 'hello good boy doiido' 
>>> print s.endswith('o') 
True 
>>> print s.endswith('ido') 
True 
>>> print s.endswith('do',4) 
True 
>>> print s.endswith('do',4,15) 
False

更多:https://www.cnblogs.com/qianyuliang/p/7491100.html

results matching ""

    No results matching ""