"John Salerno" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> if domain.endswith(".net"): >> rec = clean_net(rec) >> >> if domain.endswith(".com"): >> rec = clean_net(rec) >> >> if domain.endswith(".tv"): >> rec = clean_net(rec) >> >> if domain.endswith(".co.uk"): >> rec = clean_co_uk(rec) >> >> if domain.endswith(".info"): >> rec = clean_info(rec) > > Hmm, my first thought is to do something like this with all these if > tests: > > for extension in [<list all the extensions as strings here>]: > rec = clean_net(extension)
Whoops, you'd still need an if test in there I suppose! for extension in [<list all the extensions as strings here>]: if domain.endswith(extension): rec = clean_net(extension) Not sure if this is ideal. -- http://mail.python.org/mailman/listinfo/python-list