Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Programming the Fibonacci sequence

Loading...

Sign in or sign up now!
5,708
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jan 22, 2009

In this video, I show how to compute values of the Fibonacci sequence in python. This is also a great chance to learn about recursive function calls and the usefulness of memoization.

made for mathskool.com

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (tylerneylon)

  • of course there is a better way of doing this than using a recursive function (eek!)... but using a dict to memorize the values was tight.

  • thanks

    Using the dict as a default value for a function parameter still feels hacky to me. I could have used another global variable instead, but coders usually think of globals as even worse. I wish I could just use a static var, as in C-flavor languages. I guess the "right way" to do that in python is probably to build a class with a member variable, but that would have been way too much coding for a math-focused video.

see all

All Comments (4)

Sign In or Sign Up now to post a comment!
  • This would be a nice tutorial for me if I wanted to learn Python or could learn Python. Right now, I cannot as I am learning JAVA.

  • awesome

  • Very informing!

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more