Conditional else/if operator to perform different functions When the object is in edit mode, I want to execute this:-

bpy.ops.object.modifier_add(type='SUBSURF")


And if the same object is in object mode, I want to execute this instead:-

bpy.ops.object.modifier_add(type='SOLDIFY')


I'm really confused about setting up the conditional operators regarding to the context of the object(modes). How do i it ?
You can check this in the context.

mode = bpy.context.active_object.mode
if mode == 'EDIT':
    ...

elif mode == 'OBJECT':
    ...