Size of marker by condition plotly graph (go)

Hi here
i was able to do something like that:

go.Scatter(x=df['tim'],y=df['number'],mode="markers",marker=dict(color=(df.test=='P').astype('int),
                colorscale=[[0,'red'][1,'red']]),
                size=6
)

to change the color of the the markers depending on test (if P or F)
Is there a way to do the same thing with size? like size = 6 if df.test==ā€˜pā€™ else 15?

thank you in advance