import gym
env = gym.make('CartPole-v0')

# n_a = env.action_space.n
# n_s = env.observation_space.n
#
# print("Nb_Actions: {}".format(n_a))
# print("Nb_States: {}".format(n_s))

for i_episode in range(200):
    observation = env.reset()
    for t in range(100):
        env.render()
        print(observation)
        action = env.action_space.sample()
        observation, reward, done, info = env.step(action)
        if done:
            print("Episode finished after {} timesteps".format(t+1))
            break

env.close()

import gym
env = gym.make('CartPole-v0')

# n_a = env.action_space.n
# n_s = env.observation_space.n
#
# print("Nb_Actions: {}".format(n_a))
# print("Nb_States: {}".format(n_s))

for i_episode in range(200):
    observation = env.reset()
    for t in range(100):
        env.render()
        print(observation)
        action = env.action_space.sample()
        observation, reward, done, info = env.step(action)
        if done:
            print("Episode finished after {} timesteps".format(t+1))
            break

env.close()

# n_a = env.action_space.n # n_s = env.observation_space.n # # print("Nb_Actions: {}".format(n_a)) # print("Nb_States: {}".format(n_s))