xxxxxxxxxx
# Example using for loop with range
for num in range(1, 5):
print(num)
xxxxxxxxxx
#Python range() example
print("Numbers from range 0 to 6")
for i in range(6):
print(i, end=', ')
xxxxxxxxxx
-- In range loops are really easy to make.
-- It does not require pairs() or ipairs(), those are table iterations.
-- A in range loop is exactly as is:
for variable in 10 do
print(variable)
variable = variable + 1
end
-- If the above block fails it's purpose, the bottom block is a replacement.
for variable = 0, 1, 1 do
print(variable)
variable = variable + 1
end