Skip to content

Instantly share code, notes, and snippets.

@cupofcodeblog
Last active December 24, 2024 19:47
gather_categories()
def gather_categories(json_obj):
categories = []
for payslip in json_obj:
for attribute in payslip.keys():
if(attribute not in categories):
categories.append(attribute)
return categories
def main():
...
print(gather_categories(json_payslips))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment