When I input text for my verdict I can put anything, e.g. "zzzzz", and the program continues on through the list.
I want the program to stop when user inputs "Guilty". And only move on when user inputs "Not Guilty".
This is what I have so far, I also tried using while True
if that's better?
guilty = False
character = ["Miss Scarlett", "Professor Plum", "Mrs Peacock", "Reverend Green", "Colonel Mustard", "Dr Orchid"]
while not guilty:
for accused in character:
verdict = input("Do you find %s guilty or not guilty? " % accused)
if verdict == "guilty":
print("User finds %s guilty" % accused)
guilty = True
break
else:
guilty = False