Task 2: Manipulating Lists Part A: Reverse Implement a function reverse_strings (my_list) that takes a list of strings,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Task 2: Manipulating Lists Part A: Reverse Implement a function reverse_strings (my_list) that takes a list of strings,

Post by answerhappygod »

Task 2 Manipulating Lists Part A Reverse Implement A Function Reverse Strings My List That Takes A List Of Strings 1
Task 2 Manipulating Lists Part A Reverse Implement A Function Reverse Strings My List That Takes A List Of Strings 1 (127.23 KiB) Viewed 34 times
Task 2: Manipulating Lists Part A: Reverse Implement a function reverse_strings (my_list) that takes a list of strings, and returns the strings con- catenated in reverse order. You may NOT use the method reverse. You may destroy the input list in the process. Hint: which method lets you easily remove the last element in a list? How could you create a loop that uses the fact the list is getting smaller? Example: calling reverse_strings (['my', 'little', 'pony']) returns 'ponylittlemy'. 1 Part B: Complete Implement a function complete (my_list) that takes a list of integers in ascending sorted order with no du- plicates, and inserts any missing numbers to create an unbroken sequence. The function should return the reference to the original list. The original list must be altered. Do NOT return a range object that has been converted to a list. Hint: which method lets you easily insert into a list? How could you loop through a list to find the missing numbers? Example: calling complete ([12,15,19]) alters the original list to return [12, 13, 14, 15, 16, 17, 18, 19].
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply