answer 5 in python
answer 5 python optimization