You have done it in line 38.
Try to replace ids with col1 in line 44
Edit: To answer the title of the thread:
A C# ICollection(ElementId) equivalent in python : List[ElementId]
Remember the following reference
clr.AddReference(“System”)
from System.Collections.Generic import List
Example:
col1 = List[ElementId](ids)