Append string python for loop. pk} for attribute in attributes_selected: if .