how to remove letters from object name?

I’m trying to remove the last 3 characters of an objects name through script.

is it possible to do the opposite of this:

actname = bpy.context.object.name
    
    bpy.context.object.name = actname  + "_TS"

i tried:

bpy.context.object.name = actname  - "_TS"

but it doesnt work.

actname = bpy.context.object.name[:-3]
bpy.context.object.name = actname

removes the last 3 characters from the name

@Scorpion81
Thanks!