Download this file to your hard drive and follow the instructions in the Module 9 Assignment...

80.2K

Verified Solution

Question

Programming

  1. Download this file to your hard drive and follow theinstructions in the Module 9 Assignment (Word) document.
  2. Prepare two files for your post. The first file should be atext file containing your Python solution. The second file shouldcontain your output file(txt).

Complete the following using Python on a single text file andsubmit your code and your output as separate documents. For eachproblem create the necessary list objects and write code to performthe following examples:

  1. Sum all the items in a list.
  2. Multiply all the items in a list.
  3. Get the largest number from a list.
  4. Get the smallest number from a list.
  5. Remove duplicates from a list.
  6. Check a list is empty or not.
  7. Clone or copy a list.
  8. Find the list of words that are longer than n from a given listof words.
  9. Take two lists and returns True if they have at least onecommon member.
  10. Print a specified list after removing the 0th, 4th and 5thelements.
    Sample List: ['Red', 'Green', 'White', 'Black', 'Pink','Yellow']
    Expected Output: ['Green', 'White', 'Black']
  11. Print the numbers of a specified list after removing evennumbers from it.
  12. Shuffle and print a specified list.
  13. Get the difference between the two lists.
  14. Convert a list of characters into a string.
  15. Find the index of an item in a specified list.
  16. Append a list to the second list.
  17. Select an item randomly from a list.
  18. Find the second smallest number in a list.
  19. Find the second largest number in a list.
  20. Get unique values from a list.
  21. Get the frequency of the elements in a list.
  22. Count the number of elements in a list within a specifiedrange.
  23. Check whether a list contains a sub list.
  24. Create a list by concatenating a given list which range goesfrom 1 to n.
    Sample list : ['p', 'q'], n = 5
    Sample Output : ['p1', 'q1', 'p2', 'q2', 'p3', 'q3', 'p4', 'q4','p5', 'q5']
  25. Find common items from two lists.
  26. Change the position of every n-th value with the (n+1)th in alist.
    Sample list: [0, 1, 2, 3, 4, 5]
    Expected Output: [1, 0, 3, 2, 5, 4]
  27. Convert a list of multiple integers into a singleinteger.
    Sample list: [11, 33, 50]
    Expected Output: 113350
  28. Split a list based on the first character of a word.
  29. Select the odd items of a list.
  30. Insert an element before each element of a list.
  31. Print all elements of a nested lists (each list on a new line)using the print() function.
  32. Split a list every Nth element.
    Sample list: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j','k', 'l', 'm', 'n']
    Expected Output: [['a', 'd', 'g', 'j', 'm'], ['b', 'e', 'h', 'k','n'], ['c', 'f', 'i', 'l']]
  33. Create a list with infinite elements.
  34. Concatenate elements of a list.
  35. Convert a string to a list.
  36. Replace the last element in a list with another list.
    Sample data : [1, 3, 5, 7, 9, 10], [2, 4, 6, 8]
    Expected Output: [1, 3, 5, 7, 9, 2, 4, 6, 8]
  37. Check if the n-th element exists in a given list.
  38. Find a tuple with the smallest second index value from a listof tuples.
  39. Insert a given string at the beginning of all items in alist.
    Sample list: [1,2,3,4], string: emp
    Expected output: ['emp1', 'emp2', 'emp3', 'emp4']
  40. Find the list in a list of lists whose sum of elements is thehighest.
    Sample lists: [1,2,3], [4,5,6], [10,11,12], [7,8,9]
    Expected Output: [10, 11, 12]
  41. Find all the values in a list are greater than a specifiednumber.
  42. Extend a list without append.
    Sample data: [10, 20, 30]
    [40, 50, 60]
    Expected output: [40, 50, 60, 10, 20, 30]
  43. Remove duplicates from a list of lists.
    Sample list : [[10, 20], [40], [30, 56, 25], [10, 20], [33],[40]]
    New List : [[10, 20], [30, 56, 25], [33], [40]]

Answer & Explanation Solved by verified expert
4.2 Ratings (540 Votes)
We are allowed only to answer 5 questions still Ive answerdmore than thatHere are the code fo thoseimport numpy as npimport copyimport randomsamplelist 12341 Sum all the items in a listsumlist sumitem for item in samplelist Multiply all the items in a listmultlist npprodsamplelist Get the largest number from a listmaxitem maxsamplelist Get the smallest number from a listminlist    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students