Couple things here..
- This isn't necessarily wrong (the code will still work) but there's no reason to convert
input to a str, it already is a string
- Strings need to be in quotes, not inside
str(). Use "Red" instead
- Maybe use better variable names,
x is unclear
- The last exit is useless
Your code fixed would look something like:
selected_color = input("Select a colour: Red, Blue or Green ")
if selected_color == "Red":
print("Charmander")
elif selected_color == "Blue":
print("Squirtle")
elif selected_color == "Green":
print("Bulbasaur")
Improvements
Since you are just converting a colour to a pokemon you could use a dict here
pokemonColors = {"Red" : "Charmander", "Blue" : "Squirtle", "Green" : "Bulbasaur"}
print(pokemonColors[input("Select a colour: Red, Blue or Green ")])
Notice that this will give a KeyError for a color not in the dict, you could use .get() with a default to fix this if you want though.
"Red"or'Red'strbefore them.