Other than some generic containers like list, Python in its definition can also handle containers with specified data types. Array can be handled in python by module named “array“. They can be useful when we have to manipulate only a specific data type values.
Operations on Array :
1. array(data type, value list) :- This function is used to create an array with data type and value list specified in its arguments. Some of the data types are mentioned in the table below.
2. append() :- This function is used to add the value mentioned in its arguments at the end of the array.
3. insert(i,x) :- This function is used to add the value at the position specified in its argument.
python - Sample - python code :
python tutorial - Output :
4. pop() :- This function removes the element at the position mentioned in its argument, and returns it.
5. remove() :- This function is used to remove the first occurrence of the value mentioned in its arguments.
python - Sample - python code :
python tutorial - Output :
6. index() :- This function returns the index of the first occurrence of value mentioned in arguments.
Wikitechy tutorial site provides you all the learn python , learn python programming online , best python course online , best online
course for python ,
python online learning
Related Searches to Array in Python | Introduction and Functions
python two dimensional arraypython array slicepython define arraypython append arraypython declare arraycreate array pythonpython ndarraypython join arraypython reverse arraynp array pythonlength of array pythonpython array to listpython np arrayprint array pythonpython array of stringsndarray pythontwo dimensional array pythonpython 2 dimensional arraypython array count2d array in pythonpython array joinarray size pythonpython in arrayarray to string pythonpython array of objectspython add element to arraypython array vs listnumpy array pythonpython array listarray python exampleconvert list to array pythonstring to array pythonpython for loop arraypython array declarationpython array rangepython 3 arraypython array insertarray in python examplecreate array in pythonpython array findhow to create an array in pythonpython array operationspython array functionsdefine array in pythonpython array shapepython size arraycreate an array in pythondeclare array in pythontwo dimensional array in pythonhow to make an array in pythonlength of array in pythonpython array syntaxprint array in pythonpython array multiplicationpython array of tupleshow to declare array in pythonpython array modulearraylist pythonpython list of arrayspython array initializationpython array remove elementhow to define array in pythonarray python 3string array in pythonpython make arrayhow to create array in pythonhow to declare an array in pythonarray en pythonhow to use array in pythonhow to define an array in pythondeclare an array in pythonpython numpy installpython numpy arraynumpy tutorial pdfscipy tutorialnumpy functionspython numpy matrixpython scipynumpy download