Python  1.0
Functions
_01a_fibo Namespace Reference

Fibonacci sequence. More...

Functions

def Fibo (n)
 Prints the first n Fibonacci numbers. More...
 
def main ()
 

Detailed Description

Fibonacci sequence.

An explanation about range x xrange.

  1. for x in range(10000): will generate a list of ten thousand elements, and will then loop through each of them in turn.
  2. for x in xrange(10000): will generate ten thousand integers one by one, passing each to the variable x in turn. xrange(10000) returns (what is essentially) an iterator sequence, and consumes the same amount of memory, regardless of the size of the requested list.
  3. xrange is the one to use if you're looking to generate a huge list of numbers to pass through in something like a for loop, but range is much more flexible as it truly generates an anonymous list.
  4. xrange is deprecated in python 3.
Author
Paulo Roma
See also
http://en.wikipedia.org/wiki/Fibonacci_number

Function Documentation

◆ Fibo()

def _01a_fibo.Fibo (   n)

Prints the first n Fibonacci numbers.

Parameters
namount of Fibonacci numbers to be printed.

Referenced by main().

◆ main()

def _01a_fibo.main ( )

References Fibo(), and _01d_dec2bin.input.