use python

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question
use python
Write a function called myFunction:
The function has 1 parameter: a list called nestedList - its elements are lists
O each inner list has exactly two strings as its elements, see examples below
The function creates and returns a new non-nested list with strings as its elements
each string is the result of concatenating the two strings from the inner lists - see
example below
O
Sample calls to the function:
n1 = [['sept', '97'], ['dec', '22']]
res = myFunction(n1)
res will correspond to the list ['sept-97', 'dec-22']
n2 = [['a','b'], ['e','f'], ['x','z']]
myFunction(n2)
res =
res will correspond to the list ['a-b', 'e-f', 'x-z']
Transcribed Image Text:Write a function called myFunction: The function has 1 parameter: a list called nestedList - its elements are lists O each inner list has exactly two strings as its elements, see examples below The function creates and returns a new non-nested list with strings as its elements each string is the result of concatenating the two strings from the inner lists - see example below O Sample calls to the function: n1 = [['sept', '97'], ['dec', '22']] res = myFunction(n1) res will correspond to the list ['sept-97', 'dec-22'] n2 = [['a','b'], ['e','f'], ['x','z']] myFunction(n2) res = res will correspond to the list ['a-b', 'e-f', 'x-z']
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Introduction to computer system
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning