#!/usr/bin/env python3
""" Monte Carlo """
import numpy as np
import gym


def monte_carlo(env, V, policy, episodes=5000, max_steps=100,
                alpha=0.1, gamma=0.99):
    """ - env is the openAI environment instance
        - V is a numpy.ndarray of shape (s,) containing the value estimate
        - policy is a function that takes in a state and returns the next
            action to take
        - episodes is the total number of episodes to train over
        - max_steps is the maximum number of steps per episode
        - alpha is the learning rate
        - gamma is the discount rate
    Returns: V, the updated value estimate
    """

