Programming Assignment Unit 6 Part a Input # Roster of staff members staff_names = ["Logan Paul", "Pieter Nickol", "Mojca Dubini", "Mikayla Gimbly", "Eckert Schnyder", "Emily Hunt", "Martin Segal", "Margriet Schuster", "Gary Zhang", "Kobus Toriyama"]
# Splitting staff_names list into two sub-lists subList1 = staff_names[:5] # First 5 names subList2 = staff_names[:5] # Last 5 names
print("subList1:", subList1, "n" "subList2:", subList2).
Add new employee to subList2 subList2.append("Kriti Brown").
Removing second employee from subList1 del subList1[1] #indexing always starts at 0.
print("Updated subList1 -1:", subList1, "n" "Updated …show more content…
print("Combined list:", combiList).
Sorting combiList alphabetically for peace of mind combiList.sort().
print("Sorted Combined list:", combiList).
Salary List = [80000, 68000, 100000, 93500, 60000, 72000, 175000, 76000, 84000, 90000].
print("Staff salaries:", salaryList).
Adding 4% raise to all staff salaries for i in range(len(salaryList)): salaryList[i] *= 1.04.
print("Staff salaries after raise:", salaryList).
Sorting the salaryList …show more content…
& Co. (2015). The 'Secondary' of the 'Secondary' of the 'Secondary' of the 'Secondary' of the 'Secondary' of the 'Secondary' of the 'Second Think Python How to Think Like a Computer Scientist 2nd Edition, Version 2.4.0. https://greenteapress.com/thinkpython2/thinkpython2.pdf How to Sort a List Alphabetically in Python. 2022, March 31. LearnPython.com - LearnPython.com - LearnPython.com - LearnPython.com - LearnPython.com - LearnPython.com - LearnPython.com - LearnPython. https://learnpython.com/blog/sort-alphabetically-in-python/ Python list reversal vs list sorting. n.d. - n.d. - n.d. www.linkedin.com - www.linkedin.com - www.linkedin.com - www.linkedin.com - www.linkedin.com - www.linkedin.com - www.linkedin.com - www.linkedin.com - www.linkedin. Retrieved March 14, 2024, from https://www.linkedin.com/pulse/python-list-reversal-vs-sorting-hotkeyexcel Python List Slicing. (2019, June 12). The. Learn by example.