python ex4 and ex5

going to sleep,good luck!today