DEV Community

Jay
Jay

Posted on

range

Create a sequence of numbers from 2 to 2, but increment by 3 instead of 1:

for n in range(2, 12, 3):
    print(n)
Enter fullscreen mode Exit fullscreen mode

The formula is

for variable in range(start, end, increment) you should
print(variable)

Top comments (0)