I have a nested for loops as you can see below:
cv_list_dic = cv_list()
for cv in cv_list_dic['results']:
cv_name = cv['name']
if qq_cv(cv_name):
cv_versions = (cv['versions'])
cv_id_list = []
for cv_ids in cv_versions:
ver_id = (cv_ids['id'])
cv_id_list.append(ver_id)
max_id = (max(cv_id_list))
qq_cv_id = (cv_name, max_id)
print(qq_cv_id)
the output is a list of tuples (there is much more tuples, its just example):
('cv1', 152)
('cv2', 35)
My issue that I need those tuples outside of those for loops. I have tried to create an empty list and append to it but it's appending only the last item.