How to kill creepers without dying?
Solution 1:
Without using commands, I'd say the easiest way to take them down would be with a bow and arrow. This way you kill them from a distance without having to worry about the explosion. If all you have is a sword, you have to employ a hit and run tactic. Run up to it, hit it once, and then quickly run backwards away. If you time it right, you can get far enough away before it explodes. Keep doing this and eventually it will die.
Alternatively, as TylerH points out in the comments, if you can enchant a sword with Knockback, it will significantly help when dealing with them in close combat. Also, making splash potions of harming would be another way to take them out from a distance, although I'm not sure how far you can throw potions.
Solution 2:
Avoid them if possible! If you're after the gunpowder drop, armour up, get a good sword, and run through them swinging. Keep running till you get outside their trigger radius (they'll quit hissing), then do it again. With a good sword you'll kill them in three passes, and with good armour you can survive the occasional blast.
Or, snipe them from a distance with arrows. In a new game, before I have the materials for decent armour and weapons, I just run from creepers.
Keep in mind: Creepers often spawn in pairs. I think this is in the wiki; I've certainly observed it.
It's tough to lose a dog in Minecraft. And they're so dumb about falling into pits and getting between you and the thing you're attacking.
Solution 3:
As others have said, you want to keep them at a distance. Even in fully enchanted diamond armor, a point-blank Creeper explosion can be instant death on Hard (though, usually when this happens to me, it's the fall that does the final damage).
Before you get a bow, your best bet is to avoid them. If you find yourself in a position where you can't back away from them, strike them with your sword while sprinting (ctrl + W on PC to sprint) to get a boost to how far you knock them back, giving you a bit of breathing room before they explode! The knockback is quite impressive and can turn a deadly Creeper encounter into relatively minor damage.
You'll probably craft a shield before you get a bow (1 Iron Ingot and 6 wood, easy to obtain!). If you aren't desperately trying to avoid an explosion, raise your shield and you will nullify all damage from the blast. This hurts your shield, but better it than you.
Once you do get a bow and a supply of arrows, Creepers become much easier to deal with. Target and kill them before you get within aggro range when possible; it usually doesn't take more than a couple shots.
Knockback on a Sword makes Creepers laughably easy to deal with as a simple smack will send them flying back several meters. It's not as good as a bow, but it's better than nothing when one sneaks up on you or drops in on you in a ravine (Ravines are the places where creepers are most deadly, in my experience).
Finally, you can use Skeletons to kill Creepers. It's not an easy task, but if a Skeleton kills a Creeper, it will always drop a random record. Most records can only be obtained this way.
EDIT: Oh yeah, and Creepers are afraid of tamed cats and will run away from them. It's not terribly useful, but it is a thing that makes them a bit easier to kill provided your cats cooperate.