[Python] Why am I still getting, "You didn't give me a valid value, please try again! after...

Discussão em 'Python' iniciado por Stack, Abril 11, 2025.

  1. Stack

    Stack Membro Participativo

    colors_list = []

    while True:
    user_input = input("Enter a color to add to the list(or type 'done' to finish): ")
    if user_input.lower() == 'done':
    break
    colors_list.append(user_input)

    print('Here is the list:')
    print(colors_list)

    while True:
    user_input = input("Enter a color:")
    if green in colors_list:
    print('Yes!', 'green', 'is in the list')
    break
    else: print("You didn't give me a valid value, please try again!")

    Continue reading...

Compartilhe esta Página