I want to know whether there is an equivalent statement in lists to do the following. In MATLAB I would do the following
fid = fopen('inc.txt','w')
init =1;inc = 5; final=51;
a = init:inc:final
l = length(a)
for i = 1:l
fprintf(fid,'%d\n',a(i));
end
fclose(fid);
In short I have an initial value, a final value and an increment. I need to create an array (I read it is equivalent to lists in python) and print to a file.