PYTHON PROGRAMMING. PART II: PYTHON OBJECTS AND DATA STRUCTURE BASICS. UNIT 4: LIST
PYTHON PROGRAMMING PART II : PYTHON OBJECTS AND DATA STRUCTURE BASICS UNIT 4: LIST I. Definition Lists are constructed with brackets [] and commas separating every element in the list. Assigning a list: my_list = [1,2,3] list2 = ['string', 1, 5.3] len() function tells how many items are in the sequence of the list. print( len(my_list) ) => 3 II. Indexing and slicing Let: my_list = ['one', 'two', 'three', 4, 5] print( my_list[0] ) => 'one' ...