Binding console commands to keys

Say if I want to be able to explode myself on command during a game. Instead of havign to go into the console and take the time to type "explode" and missing all the bits flying eveywhere, can I just assign it to a key on the keyboard?