Help me please, how I can write two action in the body of the cycle "for"?
For example, if I need to write Print[] and Append[] at each iteration.
Help me please, how I can write two action in the body of the cycle "for"?
For example, if I need to write Print[] and Append[] at each iteration.
You can use CompoundExpression (;) (expressions separated by ;) in any argument of For:
For[i = 0; a = {}, i < 4, i++, Print[i]; AppendTo[a, i]]
Print[...];Append[...]? (See CompoundExpression in the docs.) – kglr Jun 09 '19 at 22:51