Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Python Part III: Letter Puller (20 points) Write a function pull () that takes two arguments, in the following order: 1. strings: a list
In Python
Part III: Letter Puller (20 points) Write a function pull () that takes two arguments, in the following order: 1. strings: a list of strings (e.g., [' abcde', 'fghj', 'jk]) 2. i: an integer that indicates which character of each string the function will extract (pull out) The function extracts the character at index i of each string, appends the characters to an empty list, and then returns the resulting list. For example, if i-2, then the function extracts the character at index i of each string, if such a character exists, and appends them to a list. For the list of strings above the returned result would be 'c', 'h' Hints: Recall that the valid indexes of a list are 0 through len (list.name)-1. Use this fact to see if a list is long enough to have a character with index i. . To create an empty list, type list-name = [ ] , where list-name is the name of the list. Use the append method to append an item to the end of a list. For example, to append letter to the list called result, type result.append (letter)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started