Good afternoon dear! I have a big question about a Python3 activity! Follow the activity link: link
Firstly, I will send my code so that they understand how I thought and how I did it (without considering the part of solved cases, dead people, etc.)
#-* coding utf-8-*-
N=int(input())
if N<0 or N>100:
print("Valor inválido na entrada.")
else:
caso={}
deceased={}
killer={}
xeroque={}
for n in range(N):
assassino,vítima,detetive=input().split()
caso[assassino]=["assassino"]
caso[vítima]=["vítima"]
caso[detetive]=["detetive"]
deceased[vítima]=["vítima"]
killer[assassino]=["assassino"]
xeroque[detetive]=["detetive"]
if assassino in detetive:
caso[assassino]=caso[detetive]
for i in sorted(caso):
print(60*"-")
if i==assassino: #ASSASSINO
if i in deceased:
print(str(i)+" (in memoriam):"+" assassino(a).")
elif i in xeroque:
print(str(i)+" :"+" detetive.")
break
elif i in killer:
print(str(i)+":"+" assassino(a).")
elif i==vítima: #Vítima
if i in killer:
print(str(i)+" (in memoriam):"+" assassino(a).")
elif i in xeroque:
print(str(i)+" (in memoriam):"+" detetive.")
else:
print(str(i)+" (in memoriam):"+" vítima inocente.")
elif i==detetive: # Detetive
if i in killer:
print(str(i)+":"+" detetive.")
elif i in deceased:
print(str(i)+" (in memoriam):"+" detetive.")
elif i in xeroque:
print(str(i)+":"+" detetive.")
print(sorted(caso.items()))
print(killer.items())
print(deceased.items())
So far I have done this. However, soon in the third test (Maria Cicero Bianca and Maria Alan Bianca) goes wrong, once the output looks like this:
2 maria cicero bianca
maria alan bianca
alan (in memoriam): innocent victim.
Bianca: Detective.
Maria: Assassin.
I can not understand why the program does not read cycero, since I print the case and victims dictionary and it appears as a victim in both!