27.3k views
20 votes
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

User SZT
by
3.6k points

1 Answer

4 votes

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()

User Kurisu
by
2.9k points