Doubts with Python
<p>I have a question. Here you have part of my code for a better understanding:</p>

<pre><code>def client ():
    A=[]
    B = open("clientes.txt", "r")
    user = input("To begin, enter your ID number: ")
    for line in B:
        C = line.split("$")
        A.append(C)
    for i in range (len(A)):
        if A[i][0]==user:
</code></pre>

<p>and then I have another function, here is it:</p>

<pre><code>def clientpersonalinfo ():
    A=[]
    B=[]
    C = open("accounts.txt", "r")
    D = open("clients.txt", "r")
    for line in C:
        E=line.split("$")
        A.append(E)
    for line in D:
        F=line.split("$")
        B.append(F)
    for i in range (len(A)):
        ***if user==A[i][1]:***
</code></pre>

<p>The question is if there is any method in which i can re-use the first input. As you see if I run this, there will be an error saying that the name "user" is not defined. </p>

<p>So I want to know if I can recall the user input that I first used in clients () and re-use it in my clientpersonalinfo () function.</p>

<p>Thanks for your help!!</p>

<p>Thanks to all those who helped me! Thanks a lot! :)</p>
