Hello - I’m guessing you’ll want to make a list and append it with each new ‘surf’, but keep in mind that each ‘surf’ in the script will be a guid and not a surface object. Also, increment ‘j’.
import rhinoscriptsyntax as rs
center=(0,0,0)
radius=1
j=0
ids = []
while j<4:
surfId = rs.AddSphere(center,radius+j)
if surfId: ids.append(surfId)
j += 1
or, more compactly:
import rhinoscriptsyntax as rs
center=(0,0,0)
radius=1
ids = [rs.AddSphere(center,radius+j) for j in range(4)]