my first real program blows up, can someone tell me why?
Fredrik Lundh
effbot at telia.com
Sun Mar 5 11:55:50 EST 2000
Jerry F. Davis <jfdecd at execpc.com> wrote:
> I read the tutorial and tried a variation on what i saw there. and it
> blew up, with a integer overflow. can someone tell me why?
a better problem description would be "why doesn't
the loop in the 'fib' function stop?"
the reason is that "b" is a number, and "n" is a string
(for more info on comparisions, see chapter 5.9 in the
language reference)
adding a conversion will fix this:
x = int(sys.argv[1])
</F>
More information about the Python-list
mailing list