Better way to sift parts of URL . . .

Ben Wilson dausha at gmail.com
Wed Apr 19 14:44:53 EDT 2006


In practice, I had to change this:
  if len(query) > 0 and query[-1] == query[-1].capitalize(): group =
query.pop()

to this:
  if len(query) > 0 and query[-1][0] == query[-1].capitalize()[0]:
group = query.pop()

This is because I only wanted to test the case of the first letter of
the string.




More information about the Python-list mailing list