0
There is an exercise that consists of typing an N number and then typing in N lines a word and a quality. After this I must type a sentence. If in this sentence there is a word that I had typed before, its quality should be printed. Example
ENTREE
3 boldo explosiva tampa chorosa beijo calorosa Vocˆe pˆos a tampa no boldo ?
Exit
chorosa explosiva
My code is this one but it doesn’t work.
dic={}
lista=[]
n=int(input())
for i in range(n):
dic["palavra"],dic["adjetivo"]=input().split()
lista.append(dic.copy())
frase=input()
for i in frase:
if i in dic["palavra"]:
print(dic["adjetivo"])
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero