You should know that python supports slicing. If you do not, read the python tutorial.
The find function returns the first occurrence of the string you pass as the argument. [In the previous example, it returns 4].
So, when I say s[:find("<")] I mean to say " slice me s, from the beginning till the occurrence of '<' ".
You should perhaps go and read the manual if you still don't understand the code.