File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414# Element − Each item stored in an array is called an element.
1515# Index − Each location of an element in an array has a numerical index, which is used to identify the element.
1616
17+ # An array is a collection of items stored at contiguous memory locations.
18+ # The idea is to store multiple items of the same type together.
19+ # This makes it easier to calculate the position of each element by simply adding an offset to a base value,
20+ # i.e., the memory location of the first element of the array (generally denoted by the name of the array).
21+
22+ # Creating an Array
23+ # Array in Python can be created by importing an array module.
24+ # array(data_type, value_list) is used to create an array with data type and value list specified in its arguments.
25+
26+ # There are thre ways to import array module:
27+ # Using import (import array)
28+ # Using import and call alias name (import array as arr)
29+ # from modules import all methods ( from array import * )
30+
31+ # Some of the data types are mentioned below which will help in creating an array of different data types.
32+ # i - signed Int - allow positive and negative values
33+ # I - unsigned Int - allow only positive values
34+ # d - double - allow double values
35+ # f - float - allow floating point values
36+ # u - unicode character - allow unicode character values
37+ # b - signed byte integer - allow positive and negative byte integer values
38+ # B - unsigned byte integer - allow positive byte integer values only
You can’t perform that action at this time.
0 commit comments