Page 1 of 1

Warum bekomme ich immer noch: "Sie haben mir keinen gültigen Wert gegeben, bitte versuchen Sie es erneut! Nachdem Sie di

Posted: 12 Apr 2025, 03:31
by Anonymous

Code: Select all

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!")