Practice exercises from Beginning Python book