Question
Problem 7. Transpose Professor Kapp started writing a function for a module. Your job is to complete it. Fortunately for you, they left comments to
Problem 7. Transpose Professor Kapp started writing a function for a module. Your job is to complete it. Fortunately for you, they left comments to help you complete it (comments are life savers aren't they!). Complete the code in the space provided. 1 2 3 4 5 6 7 def transpose(strlist): !!! (list of str) -> list of str Return a list of m strings, where m is the length of a longest string in strlist, if strlist is not empty, and the i-th string returned consists of the 2-th symbol from each string in strlist, but only from strings that have an i-th symbol, in the order corresponding to the order of the strings in strlist. Return [] if strlist contains no non empty strings. >>> transpose([]) >>> [] >>> transpose(['']) >>> [] >>> transpose(['transpose', '', 'list', 'of', 'strings']) >>> ['tlos', 'rift', 'asr', inti', 'sn', 'pg', 'os', 's', 'e'] 8 9 10 11 12 13 14 15
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