It’s easy enough to find the radii of the spheres, but I’m not sure if there is a fairly straightforward way of separating the largest from the smallest then applying the colour.
Any pointers would be appreciated. In the meantime I’m going to keep trying.
for id in spheres:
radius = get_radius(id)
if radius >= divide :
rs.ObjectColor(id, large_color)
else:
rs.ObjectColor(id, small_color)
HTH
-Willem
Edit: I misread the question. If you want to find and colorize the largest only (and all the others different color) . You can color them all the smaller color and through @Dancergraham s sorting solution grab the largest and color that different.
Even better: largest = mylist.pop()[1] removes the final, largest item in the list and leaves all the rest so you can iterate through them. I like this solution because Python lists are optimised for quickly adding and removing items at the end.