chapter 5 of java in python