Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

data structures in python

1
2
3
4
5
6
7
8
9
my_list = [1, 2, 3, 'example', 3.132, 10, 30]
del my_list[5] #delete element at index 5
print(my_list)
my_list.remove('example') #remove element with value
print(my_list)
a = my_list.pop(1) #pop element from list
print('Popped Element: ', a, ' List remaining: ', my_list)
my_list.clear() #empty the list
print(my_list)
Source by www.edureka.co #
 
PREVIOUS NEXT
Tagged: #data #structures #python
ADD COMMENT
Topic
Name
3+8 =