Python Dynamic Array ( Vectors or ArrayList or List ) implementation

Python Dynamic Array ( Vectors or ArrayList or List ) implementation

Instructor-svgAl-Mamun Sarkar
Mar 28 , 2020

Python Dynamic Array  ( Vectors or ArrayList or List ) implementation. We can implement a dynamic array using the python build-in data type list. 

Code:

py_list = ['Mathematics', 'English', 1987, 2010]
my_list = [1, 2, 3, 4, 5, 6, 7]
print("py_list[0]: {}".format(py_list[0]))
print("my_list[1:5]: {}".format(my_list[1:5]))

del py_list[2]
print(py_list)

 

Output:

py_list[0]: Mathematics
my_list[1:5]: [2, 3, 4, 5]
['Mathematics', 'English', 2010]

 

  • Share On:
  • fb
  • twitter
  • pinterest
  • instagram