Feb-02-2017, 10:38 PM
That should work. Note that you don't really need the start variable. With just fibno and prev, you can do this:
prev, fibno = fibno, fibno + prevThe tuple on the right is calculated, and then assigned to the variables in the tuple on the left. This is a handy way to swap values that is particularly useful when calculating the Fibonacci sequence.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures