whenever I type any colour it gives me blue no matter what
The reason is simple - Any non-None or non-zero value in python is a Falsy value and others are True.
So you have input q = "Red":
if q == "blue" or "Blue":, it evaluates to if False or True which further simplifies to if True. Thus the first condition is always satisfied. And hence the flaw in your code.
To solve the problem, rephrase your code to
if q in ["blue", "Blue"]:
color="\33[0;34m"
elif q in ["cyan", "Cyan", "light blue", "Light Blue", "light Blue", "Light blue"]:
color="\033[1;36m"
elif q in ["white", "White"]:
color="\033[0;37m"
elif q in ["green", "Green"]:
color="\033[0;32m"
elif q in ["orange", "Orange"]:
color ="\033[0;33m"
elif q in ["pink", "Pink"]:
color = "\033[1;31m"
This would help.
Although a good attempt would be to write the code as follows:
q = q.lower()
if q == "blue":
color="\33[0;34m"
elif q in ["cyan", "light blue"]:
color="\033[1;36m"
elif q == "white":
color="\033[0;37m"
elif q == "green":
color="\033[0;32m"
elif q == "orange":
color ="\033[0;33m"
elif == "pink":
color = "\033[1;31m"
Note: If you want to write less code and achieve more, you can drop the if-else construct and instead use dictionary as follows:
name2code = {"blue":"\33[0;34m", "white":"\033[0;37m", "light blue":"\33[0;36m", "cyan":"\033[0;36m","green":"\33[0;32m", "orange":"\033[0;33m","pink":"\33[0;31m"}
q_code = name2code[q.lower()]