how to get the last instance of something in a string python code example Example: find last appearance python >>> s = 'hello' >>> s.rfind('l') 3