Computer Science, asked by LensEducation3287, 8 months ago

Write a short python code segment that adds up the lengths of all the words in a list and then prints the average length

Answers

Answered by akshayamca14
1

Answer:

List = []

print("How many words:")

number=int(input())

print("Add "+str(number)+ " words one by one:")

for x in range(0,number):

   List.append(len(input()))

sumoflength=sum(List)

lengthoflist=len(List)

print ("Average:"+str(sumoflength/lengthoflist))

Explanation:

Similar questions