Range[ 1, 90, 8]
Range[ 0.1, 3.0, 0.6]
The Table command is more general as it can take a function as its first argument.
Table[ i^2, { i, 1, 5}]
Table can take more than one iterator.
Table[ x^2+y^2, {x,1,3}, {y,1,4}]
The result is a list of lists in which the first list has x fixed to 1 and y
varies from 1 to
4, then x is fixed to 2 and so on. The additional braces can be removed by
using
the Flatten command.
We can add elements to an existing list by using the Append, Prepend and
Insert
commands. To combine two lists, use the Union and Join commands.
list= {}; list= Append[ list, 3] list= Append[ list, 5]
We see that Append adds the element to the end of the list. Append returns
a list with the element added, but does not modify the argument. For
example,
list1= Append[ list, 7] will not modify list.
list1= Append[ list, 7]; list list1
To modify the argument so that an additional assignment is not necessary,
use
the AppendTo command.
AppendTo[ list, element] will add the element to the list.
The corresponding functions for inserting elements at the beginning of a list
are
Prepend and PrependTo.
To insert an element into a list at an arbitrary position, use Insert. The
structure
is Insert[list,element, position]. If the specified position is a negative
integer, then the element
is inserted from the end of the list.
list= { 3, 5, 7, 13}; list1= Insert[ list, 11, -2]
To combine lists, use the Union and Join commands. Union removes any duplicates
and sorts the result while Join appends the second list to the end of the
first..
list1= { 1,1,2,3,5,8,13,21}; list2= { 3, 5, 7,11,13}; Union[ list1, list2] Join[list1,list2]
Up to Lists