I am creating a web-scraping tool for some gift cards, and I have stored the name of each gift card (which is a string, i.e "PSN") as a variable. So for example, P = "PSN"
I have a user input asking them to put in the name of the card they're after, but I want it to be restricted to the variables I have already defined, so that if they type a name other than the cards I have already allowed for, it will return an error and ask them to type the name again.
How can I go about this?
Here is the code I've written so far:
#Stored strings for each card
G = "Google".casefold()
P = "PSN".casefold()
X = "Xbox".casefold()
I = "iTunes".casefold()
N = "Nintendo".casefold()
A = "Amazon".casefold()
S = "Steam".casefold()
Card_Name = input('Enter Card Name:')
cardnameanswer = G, P, X, I, N, A, S
Card_Name = cardnameanswer