Question: 1) Create a list variable with the following data ( 0.5 marks) 2) Add a word to the beginning of the list ( 0.5 marks)

 1) Create a list variable with the following data ( 0.5

1) Create a list variable with the following data ( 0.5 marks) 2) Add a word to the beginning of the list ( 0.5 marks) 3) Delete the 7th index of the list. ( 0.5 marks) 4) Delete the entry "valuable" ( 0.5 marks) 5) Search for the value "boo". (0.5 marks) a) Delete it if found ( 0.5 marks) b) Output an error message if not found ( 0.5 marks) 6) Add any value after the item "activity" ( 0.5 marks) 7) Output every other value of the list starting with index 0 using list slicing (0.5 marks) 8) Output every other value of the list starting with index 1 using a loop ( 0.5 marks) Task 3 ( 3 marks) 1) Create a dictionary variable with the following data ( 0.5 marks) 2) Delete any key of the dictionary ( 0.5 marks) 3) Attempt to get the value of the key "hello" ( 0.5 marks) a) Include an error message if key not found ( 0.5 marks) 4) Using a loop (1 mark) a) Iterate through and output all the keys and values of the loop in the format stated below i) key=value

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!