Root Finding Algorithm Python Example