I have the following question for one of my classes but I am a bit stuck. I have created the below code but when I print it only prints the count of the last word only not for each word.
"Use a nested loop to count the letters of each element in the nmrls list, then print the element along with its number of letters."
!pip install inflect
import inflect
nmrls = inflect.engine()
x=[]
for i in range (0,22):
x.append(nmrls.number_to_words(i))
for nmrls in x:
count=0
for letter in x:
count+=1
print(nmrls, count)
xafter you add the words ?xtwice, so thecountyou're getting is actually the number of items inside ofx, not the number of letters innmrls.for letter in x:=>for letter in nmrls: