![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 17
Rep Power: 0
![]() |
Fibonacci
Hey!
I am trying to make a program that calculates the fibonacci series up to a cetain value and it worked fine but when I tried to add a feature that asks you to type a number and then calculate the serie up to that number it jst keeps going and going. I don't think that it understands that it is actually a number that I type. Have a look. fib = raw_input("Skriv en siffra:")
newnumb = fib
def fib(newnumb):
a, b = 0, 1
while b < newnumb:
print b,
a, b = b, a+b
fib(newnumb)Last edited by lingon; Apr 27th, 2005 at 2:03 PM. |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|