add elements in array in python code example
Example 1: append element to an array python
x = ['Red', 'Blue']
x.append('Yellow')
Example 2: append item to array python
data = []
data.append("Item")
print(data)
Example 3: for element in array python
itemlist = []
for j in range(len(myarray)):
item = myarray[j]
itemlist.append(item)
Example 4: python create array
variable = []