How would the following be achieved using comprehension so that bad_keys
only contains the keys where the length of the associated value
is 0?
def _check_data_for_length(self) -> []:
"""
checks the lengths of the values contained within the dictionary of members
returns a list of the keys containing data of length 0.
:return: [] keys of empty values
"""
bad_keys = []
for (key, value) in vars(self).items():
if len(value) == 0:
bad_keys.append(key)
return bad_keys