Size and weight is a big decision factor when you are trying to find the ideal camera for your needs.
In this section, We are going to illustrate Nikon L31 and Pentax K-x side-by-side from the front, back and top in their relative dimensions. Nikon L31 has external dimensions of 96 x 59 x 29 mm (3.78 x 2.32 x 1.14″) and weighs 160 g (0.35 lb / 5.64 oz) (including batteries). Pentax K-x has external dimensions of 123 x 92 x 68 mm (4.84 x 3.62 x 2.68″) and weighs 580 g (1.28 lb / 20.46 oz) (including batteries).
Below you can see the front view size comparison of Nikon L31 and Pentax K-x. Nikon L31 is clearly the smaller of the two cameras. Its body is 27mm narrower, 33mm shorter and 39mm thinner than Pentax K-x. As you can tell, actually this is not a fair size comparison since Nikon L31 has a built-in lens but Pentax K-x doesn't. Once you put a lens on K-x, its thickness will increase significantly.
Here is the back view size comparison of Nikon L31 and Pentax K-x.
Weight is another important factor especially when deciding on a camera that you want to carry with you all day.
Nikon L31 is significantly lighter (420g ) than the Pentax K-x which may become a big advantage especially on long walking trips.
Again, this comparison may not be very useful in real life as we are comparing the weight of a camera with a built-in lens to the body-only weight of an interchangeable lens camera. Once you put a lens on K-x, the total kit will weigh much higher.
Unfortunately neither Nikon Coolpix L31 nor Pentax K-x provides any type of weather sealing in their body, so you have to give extra care especially when you are shooting outdoors. If weather sealing is a must-have feature for you, check these sections: Top Compact Cameras with Weather Sealing Top DSLR Cameras with Weather Sealing
LCD Screen Size and Features
Nikon L31 and Pentax K-x's LCD screens has the same diagonal size of 2.7".
Unfortunately, both cameras has fixed screens so they don't tilt or flip in directions.