The Hammurabi Code is probably best known in popular knowledge through the phrase "An eye for an eye, a tooth for a tooth".
As the name implies, this was based on the idea that for every crime you commit, a punishment of equal severity would await you, in this sense you would knew what to expect for a certain illegal/bad deed that you have done.