Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to create dynamic list in python

# Elements can be dynamically added by calling list.append(), and removed by list.remove()

list = []

for i in range(4):
    list.append(i)

print(list)
"""OUTPUT
[0, 1, 2, 3]
"""

list.remove(1)

print(list)
"""OUTPUT
[0, 2, 3]
"""
 
PREVIOUS NEXT
Tagged: #create #dynamic #list #python
ADD COMMENT
Topic
Name
6+7 =