Cs111 Unit 1 Essay

Words: 356
Pages: 2

CS 1101-01 Programming Fundamentals - AY2024-T4 UNIVERSITY OF THE PEOPLE Programming Assignment Unit 6 Deepika Dhamija (Instructor) Date: 12 / May / 2024 Programming Assignment Unit 6 Chapters 10 - Lists

a) We have a list of 10 employee names and we need to perform several operations on this list. Let’s assume the following list of employees: employees = ['John Doe', 'Jane Smith', 'Bob Johnson', 'Alice Williams', 'Charlie Brown', 'Mary Davis', 'James Miller', 'Patricia Wilson', 'Robert Moore', 'Jennifer Taylor']

1. What is the difference between a. and a. We can split this list into two sub-lists, subList1 and subList2, each containing 5 names: subList1 = employees [:5] subList2 = employees [:5].

2. What is the difference between a'smart' and a'smart'? Let’s add a new employee, “Kriti Brown”, to subList2. SubList2.append “Kriti Brown”.
…show more content…
What is the difference between a'smart' and a'smart'? We can remove the second employee’s name from subList1: del subList1 [1] 4. Now, let’s merge both the lists: mergedList = subList1 + subList2. Assume there is another list, salaryList, that stores the salaries of these employees. We can give a rise of 4% to every employee and update the salary list. Let’s assume the following salaries: salaryList = [50000, 60000, 70000, 80000, 90000, 100000, 110000, 120000, 130000, 140000, 150000] # Including Kriti's salary salaryList = [salary List = 1.04 for salary in