May-23-2019, 03:22 PM
colours = [] while repeat = True colours.append(input('Please enter a favourite color:')) answer = input('Would you like to add another favourite color? (Y/N)') if answer = "N" or "n": repeat = False else: print("More colours!") print("So your favourite colours are:") print(colours)I've been doing google searching trying to find out why my while loop gets a syntax error. It's pointing at "while repeat = true" but I don't understand why it wouldn't work. I've looked at other websites and while they aren't using the True/False boolean like I am, I should be able to do it this way shouldn't I?
I tried parentheses "while(repeat = True)" but that didn't work either.
I've been learning from a no starch press book (Python Crash Course) but this isn't from the book. It's more free-form so there's not much I can do at this point except ask for help.