SLIDE 3 ## Ustructured Variables - LIST # ( a list of integer values...) list_1=[10, 20, 30, 40, 50] print (list_1) [10, 20, 30, 40, 50] # The object 'list' provides several methods to manipulate list and elements: # is an element in the list? - OPERATOR IN print ('is 20 in the list? ',20 in list_1) print ('is 200 in the list? ',200 in list_1) is 20 in the list? True is 200 in the list? False # what is the element in this position? list_1=[10, 20, 30, 40, 50] idx=-2 print (list_1[idx]) 40 # APPEND method: add an element to the list list_1.append(100) print (list_1) [10, 20, 30, 40, 50, 100] # A list can contain everything, not only numbers. list_2=['a','b', 'c', 'd'] list_3=[1, 'a', list_2, list_1] print (list_3) [1, 'a', ['a', 'b', 'c', 'd'], [10, 20, 30, 40, 50, 100]]