Fibonacci numbers/program
Eric Anechiarico
wedjlok at excite.com
Sat Jan 6 02:18:58 EST 2001
Hello,
I am making a program to find Fibonacci number sequences and I wanted to
know, being fairly new at python, how to get it to open a window to ask
for the input for the ranges of numbers that I want it to search
between, as well as to save the output to a text file so taht I do not
have to look at the window and copy/paste the numbers it returns, since
the buffer will fill up with large amounts of numbers and I cannot see
the beginning of the string.
Example: I want to search for the string from 1 to 10^100. An input
window opens asking for range of numbers to search between. I enter it.
Then it will give me all that it finds and then it will save that to a
text file.
The core of it will be (to find the numbers):
def FindFibBetween(A,B):
x, y = 1L, 1L
while x < B:
if x >= A: print x
x, y = y, x+y
I have that worked out and it works fine. I just do not want to go into
it each time and ask FindFibBetween(1, n). I should also mention that I
use a Macintosh computer, which has some effect as to what modules to
call and such..?
Thank you for your response, and I can supply the completed program for
all those other people who just happen to be interested in number theory
as well. <G>
Er
Sent via Deja.com
http://www.deja.com/
More information about the Python-list
mailing list