How can I store a result in a Matrix?

G

Greg Lindstrom

Here's one way (more to come, I'm sure)


fibs = []
fibs.append(1)
fibs.append(1)

for n in range(10):
new_fib = fibs[-2] + fibs[-1]
fibs.append(new_fib)

for n in fibs:
print n,
print

1 1 2 3 5 8 13 21 34 55 89 144


Greg Lindstrom (501) 975-4859
NovaSys Health (e-mail address removed)

"We are the music makers, and we are the dreamers of dreams" W.W.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Sharing Base Class members 0
Pattern Matching 0
Machine identification 1
Oracle Access via cx_Oracle 0
Working with Forms in MS Word 1
Boa Constructor Problem 5
mySQL access 2
Pmw EntryWidget Help 1

Members online

Forum statistics

Threads
474,262
Messages
2,571,054
Members
48,769
Latest member
Clifft

Latest Threads

Top