First-Day Demonstration

Do[Print[{i,i^2}],{i,1,20,3}] (* this is a loop *)

Often, we need loops that modify some variable at each iteration.

sum=0
Do[sum+=i;Print[sum],{i,1,10}]
sum

sum=0
Do[sum+=1/i;Print[{sum,N[sum],sum>3,i}],{i,1,20}]
sum