擅长:python、mysql、java
<p>由于<code>fibonacci</code>函数正在接受输入,因此不需要传递参数。但是在错误的情况下,没有在全局范围中定义<code>n</code>。我只想去掉<code>n</code>参数。另外,只要用<code>n</code>替换<code>stopNumber</code>。你知道吗</p>
<pre><code>def fibonacci():
a=0
b=1
n = input("How high do you want to go? If you want to go forever, put 4ever.")
print(1)
while n == "4ever" or int(n) > a+b:
a, b = b, a+b
print(b)
fibonacci()
</code></pre>