import gym import numpy as np import random random seed( make results reproducible np random seed( make results reproducible num_episodes discount_factor learning_rate report_interval report ' -ep average best -ep average average '(episode % )def print_report(rewardslistepisodeint)"""print rewards report for current episode average for last episodes best -episode average across all time average for all episodes across time ""print(report np mean(rewards[- :])max([np mean(rewards[ : + ]for in range(len(rewards )])