Shi Mu wrote: > what is the difference between index and find in the module of string? > for both "find" and "index", I got the position of the letter.
Chapter 2 of the Library Reference is a wealth of information about built-in types: http://docs.python.org/lib/builtin.html In particular this page http://docs.python.org/lib/string-methods.html which says find( sub[, start[, end]]) Return the lowest index in the string where substring sub is found, such that sub is contained in the range [start, end). Optional arguments start and end are interpreted as in slice notation. Return -1 if sub is not found. index( sub[, start[, end]]) Like find(), but raise ValueError when the substring is not found. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor