I want to make a new array and add some specific keys and values of the json object into the new array. My code adds only the value and not the key. Can someone help me?
CourseGroupCategoriesGroups=[{'GroupId': 11799, 'Name': 'Group 1', 'Description': {'Text': '', 'Html': ''}, 'Enrollments': [264, 265, 266, 50795, 50798]}, {'GroupId': 11928, 'Name': 'Group2', 'Description': {'Text': '', 'Html': ''}, 'Enrollments': [49039, 49040, 49063, 49076, 50720, 50765, 50791]}]
GroupMembership =[]
for record in CourseGroupCategoriesGroups:
GroupMembership.append(record['Name'])
print(GroupMembership)