words=["apple","banana","peach","plum","grapefruit"]
length=len(words[0])
indx=0
for i in range(len(words)):
if len(words[i])<length:
length=len(words[i])
indx=i
print("Shortest word is:",words[indx])
numbers = [3,17,1,44,239]
sum=0
for i in range(len(numbers)):
sum=sum+numbers[i];
length=len(numbers)
avg=sum/length
print("Average of list is: ",avg)
Get Answers For Free
Most questions answered within 1 hours.