PythonPython Tips and TricksIn Python, Every Object Has a Boolean True or False ValueThe built-in bool() function will return the boolean equivalent of any argument it's give.
PythonPython Tips and TricksCounter() Provides an Easy Way to Count How Many Items of Each Type Are In Python Collection ObjectsCounter is a member of the collections module. You can give Counter() any iterator, and it will return a hashmap (like a dictionary) with the counts.