how to check wether deque is empty in python code example Example: python deque empty if d: # not empty else: # empty