I'm relatively new to Python, and something is acting up. Basically, when I call str.rfind("test") on a string, the output is the same as str.find("test"). It's best that I show you an example:
Python 2.6.5 (r265:79063, May 6 2011, 17:25:59)
[GCC 4.5.0 20100604 [gcc-4_5-branch revision 160292]] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import string
>>> line = "hello what's up"
>>> line.rfind("what")
6
>>> line.find("what")
6
By my understanding, the value of line.find is okay, but the value of line.rfind should be 9. Am I misinterpreting these functions or not using them well?