0

Can't exit the while loop, even when input is "red" or "green"

player_lc = input("What color do you wish to be?: ") #Player can chose color

while player_lc != "red" or "green":
        print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
        print("That is not an available color, chose another")
        print("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")
        print("")
        player_lc = input("What color do you wish to be?: ")  #players get to chose color again
        print("")
  • You could use `player_lc != "red" and player_lc != "green"` or `player_lc not in ("red", "green")` – Dennis Apr 26 '22 at 23:10

0 Answers0