The for loop is used for iterating over a range of values or elements, executing a set of statements a specified number of times.