Select objects with prefixes using Python

Hi everyboady,

I’m trying to select objects with many prefixes, but it dosen’t work if I change the prefixes order. I tried with this code :

for obj in bpy.context.scene.objects:
    if'BGR_' and 'M_' and 'L_'):

Any idea ?
Have a nice coding day !

I change the code like this and it works :

for obj in bpy.context.scene.objects:

It doesn’t work without double parenthesis.

the ‘double parenthesis’ you mentioned is a tuple. without parens around the tuple, they are just parameters.

1 Like