for i from 1 to 3 do
i, i**2
end do;i;for i from -3 to 0 do i; end do;for i from 0 to 30 by 7 do; i; end do;A :=[5,3,7,9,2,3];for i from 1 to 6 do
A[i];
end do;for i from 1 to 6 do
A[i]**2;
end do;B :=[1,2,3,4,5,6];for i from 1 to 6 do
A[i], B[i];
end do;for i from 1 to 6 do
for j from 1 to 6 do
print(A[i], B[j]);
end do;
end do;A;nops(A);for i from 1 to nops(A) do
print(A[i])
end do;A;op(A);A :=[op(A), 7];A :=[2, 4, 2, 6, 7, 4, 3, 2, 4];for i from 1 to nops(A) do
A[i];
end do;total :=0: identity operator (for addition it's 0 )
for i from 1 to nops(A)-1 do have to subtract the last term to account for the one less term
total := total +(A[i]+A[i+1])/2;
end do:
total;total :=1: its the identity operator (the number that doesn't change the value, for multiplication it's 1)
for i from 1 to nops(A)do have to subtract the last term to account for the one less term
total := total*A[i];
end do:
total;for x in A do
x;
end do;Students :=['bob', 'mary', 'travis'];for s in Students do print(s);
end do;for s in [3,4,5] do print(s);
end do;A;B;for x in A do
for y in B do
print(x,y, evalf(sqrt(x**2+y**2)));
end do;
end do;