update chapter21 python