I apologize in advance, I'm an absolute beginner. What I'm trying to do is have a for loop check user input against a list to see if it's contained in that list, and if it is, place the index of that list in a variable so it can be used to access an item in another list. Here is my code so far:
cust = ["Jim", "Jane", "John"]
bal = [300, 300, 300]
curCustIndex = ""
custName = input("What is your name?")
""" Let's assume the user chose "Jane" """
for i in cust:
if custname == cust[i]:
curCustIndex = i
Basically, what I want is for the curCustIndex to be set to an index, such as [1] for "Jane", so I can use it to correspond with an index in another list, such as the bal list. In this case, bal[1] would be the balance for "Jane." I've tried to search for an answer, but a lot of the related topics are a little too advanced for me understand. Oh, and yes, I'm intentionally using global variables. This is a beginner's python class.
Thanks in advance