You use range operators to specify a range of integers such as 1 through 10. There are two types of range operators: the closed range operator (...) and the half-open range operator (..<).
Closed Range Operator
The closed range operator gives you a way to specify a range of numbers when you want to include the number that defines the end of the range. You must specify the beginning of the range and the end of the range with the closed range operator (...), as shown in Listing 17-1.
Listing 17-1. Closed Range Operator
Listing 17-2. Closed Range Operator in a for Loop
for i in ...