4.5.2.7 Lists

Note that list appends are completely different in KASH than in Python. Use underscore after the function name for the mutation version.
sage: v = kash([1,2,3]); v
[ 1, 2, 3 ]
sage: v[1]
1
sage: v[3]
3
sage: v.Append([5])
[ 1, 2, 3, 5 ]
sage: v
[ 1, 2, 3 ]
sage: v.Append_([5, 6])
SUCCESS
sage: v
[ 1, 2, 3, 5, 6 ]
sage: v.Add(5)
[ 1, 2, 3, 5, 6, 5 ]
sage: v
[ 1, 2, 3, 5, 6 ]
sage: v.Add_(5)
SUCCESS
sage: v
[ 1, 2, 3, 5, 6, 5 ]

The Apply command applies a function to each element of a list.

sage: L = kash([1,2,3,4])
sage: L.Apply('i -> 3*i')
[ 3, 6, 9, 12 ]
sage: L
[ 1, 2, 3, 4 ]
sage: L.Apply('IsEven')
[ FALSE, TRUE, FALSE, TRUE ]
sage: L
[ 1, 2, 3, 4 ]

See About this document... for information on suggesting changes.