sjdevnull at yahoo.com wrote: > for line in (l.rstrip("\n") for l in file("test.txt", "rU") if l[0] != > "\n"): > k, v = line.split() > d.setdefault(k, []).append(v) Note that this snippet will produce the same output with or without the rstrip() method call. Peter