Update prob5.py

this idea taken from varun tahnks