In order to perform a walk on a real environment, humanoid robots need to adapt themselves to the environment, as humans do. One approach to achieve this goal is to use Machine Learning techniques that allow robots to improve their behavior with time. In this paper, we propose a system that uses Reinforcement Learning to learn the action policy that will make a robot walk in an upright position, in a lightly sloped terrain. To validate this proposal, experiments were made with a humanoid robot -- a robot for the RoboCup Humanoid League based on DARwIn-OP. The results showed that the robot was able to walk on sloping floors, going up and down ramps, even in situations where the slope angle changes.