擅长:python、mysql、java
<pre><code> if confirm == "y":
password = input("\tenter password ) ")
</code></pre>
<p>您在这里定义了一个名为<code>password</code>的变量,它隐藏了在顶层定义的<code>password()</code>函数。</p>
^{pr2}$
<p>在这里,您尝试调用作为输入的字符串,就好像它是一个方法一样。</p>
<p>您需要做的是为字符串和函数使用不同的名称。我建议将函数调用为<code>request_password</code>或<code>input_password</code>。</p>