I started learning python, I don’t understand what’s wrong with the code. Here is the task:
rainbow rainbow rainbow rainbow rainbow rainbow rainbow rainbow rainbow rainbow rainbow rainbow
In short, in 4 attempts using while to find in a string variable the color that will be entered via input
rainbow = "red orange yellow green blue indigo violet" tries = 0 while True: color = input("Try your color: ") tries += 1 if tries == 4: break elif color in rainbow == True: print ("Correct!") break
color in rainbow == True->color in rainbow.split()- MaxU