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
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
India Languages,
5 months ago
Computer Science,
5 months ago
English,
5 months ago
English,
10 months ago
Biology,
1 year ago
Hindi,
1 year ago