I made this code to give back user input in different colors. The user should be able to type what they want and choose the color they want.
When I run the code, it works only if I type the colors in correctly. The if statement for the colors isn't working.
This is the code:
from termcolor import colored
while True:
try:
Colors = ['grey', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']
print("Colors = grey, red, green, yellow, blue, magenta, cyan, white")
if input("Enter a Color: ") != Colors:
print("Not a Valid Color ")
elif input("Enter a Color: ") == Colors:
print(colored(input("Type Something: "), input("Enter a Color: ")))
else:
continue
except ValueError:
print("Not a Valid Color")