I am having some difficulty figuring this out. The question in my assignment asks that we:
Print the elements in the
nmrlslist that have more than or equal to 7 letters and has either the letter 'o' or the letter 'g'.
and the results should be three (eighteen, fourteen and twenty-one) but I only get twenty-one.
What am I doing wrong?
Also unrelated question, do we always have to run the entire code every time we open Jupyter notebook (for a sophisticated language it seems very cumbersome)?
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 nmrls:
count+=1
if count>=7 and "o" or "g" :
print(nmrls)