On 2016-12-30 19:59, Deborah Swanson wrote:
> Similar, actually the same as Cameron suggested. I really need to
> revisit testing for empty. I probably rejected it early on for some
> bad reason (you don't understand everything that goes wrong when
> you're learning).

If your data is anything like what I often get, it had spaces in it,
and

  x = " "
  if x:
    print("yep")
  else:
    print("nope")

prints "yep".  So when processing data like this, I prefer to take a
cleaning pass over everything to strip out leading/trailing
whitespace before attempting to use any logic on it.

-tkc


-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to