Python alternative for your function
def test():
for i in range(1, 10):
print(i)
Note out that python has no variable declaration as it is not strongly-typed language.
Also instead of next it has indentation as depth of execution.
solved Python FOR Loop [closed]