Create shortcut with python command?

Is it possible to create shortcuts with Python commands? I’m trying to create shortcuts for these two commands,

  1. Delete keyframe bpy.ops.anim.keyframe_delete()
  2. Insert keyframe bpy.ops.anim.keyframe_insert()

    These are the two commands from Timeline’s Insert and Delete keyframe buttons which are different from I and ALT I shortcuts. Thanks in advance.

Never mind, I just figured it out.