The range() function accepts three arguments: start, stop and step.
Example that counts 4, 8, 10:
func _ready(): for i in range(4, 10, 2): print(i)
Open example in GDScript Playground