###### tags: `courseHandson` # List ### Use below list to perform all tasks if not mentioned explicitly ``` python number_list = [ 1,2,3,'r', [ 1, 2, 3, 'S'], { 'color': 'orange' }, ('a', 'b', 'c', 'd'), 'Simple' ] ``` ### Tasks ##### Print all elements of list with index Expected Output ``` python index value 0 1 1 2 2 3 3 'r' 4 [1, 2, 3, 'S'] 5 {'color': 'orange'} 6 ('a', 'b', 'c', 'd') 7 'Simple' ``` ##### Print type of all elements of list with there index Expected Output ``` python index type 0 <class 'int'> 1 <class 'int'> 2 <class 'int'> 3 <class 'str'> 4 <class 'list'> 5 <class 'dict'> 6 <class 'tuple'> 7 <class 'str'> ``` ##### Loop through all element, elements are valid only if its a number and print index,type and valid or invalid. Expected Output ``` python index type isvalid 0 <class 'int'> true 1 <class 'int'> true 2 <class 'int'> true 3 <class 'str'> false 4 <class 'list'> false 5 <class 'dict'> false 6 <class 'tuple'> false 7 <class 'str'> false ``` ##### Replace all string in the list to A. print all elements with index and value Expected Output ``` python index value 0 1 1 2 2 3 3 A #changed values 4 [1, 2, 3, 'S'] 5 {'color': 'orange'} 6 ('a', 'b', 'c', 'd') 7 A #changed values ``` ##### Add 10 to all child list elements if its a number. print all elements of parent list with index and value Expected Output ``` python index value 0 1 1 2 2 3 3 'r' 4 [11, 12, 13, 'S'] #changed values 5 {'color': 'orange'} 6 ('a', 'b', 'c', 'd') 7 'Simple' ``` ##### print only dict from the list Expected Output ``` python {'color': 'orange'} ``` ##### convert below list to string ``` python list_to_convert= ['L', 'o', 'r', 'e', 'm'] ``` Expected Output ``` python Lorem ``` ```