Explore Westonci.ca, the top Q&A platform where your questions are answered by professionals and enthusiasts alike. Explore a wealth of knowledge from professionals across various disciplines on our comprehensive Q&A platform. Explore comprehensive solutions to your questions from knowledgeable professionals across various fields on our platform.

Write a function named add_surname that takes as a parameter a list of first names. It should use a list comprehension to return a list that contains only those names

Sagot :

def accumulating():

 List = []

 Strings = input("Please enter a list of strings: ")

 List = Strings.split(" ")

 return List

def length(n):

 r = []

 for i in n:

   r.append(len(n))

 return r

def main():

 y = accumulating()

 x = length(y)

 print(x)

main()