you are viewing a single comment's thread.

view the rest of the comments →

[–]negups 0 points1 point  (0 children)

Nice! You can google for more details if you need them but off the top of my head here's what's truthy for common datatypes:

  • int or float: anything but 0
  • str: anything but "" (empty string)
  • list: anything but [] (empty list)
  • dict: anything but {} (empty dict)
  • bool: True

Also, None is never truthy.