Root Finding Algorithm Python Example Problem