learn hard python exercise. 2013-6-12