On Monday, 23 January 2006 at 10:59:24 +1100, Shuying Wang wrote: > I'm guessing when you did that, you got something like an IndexError. > That's because you didn't check the length of "a" from raw_input and > accessed a nonexistent array element (a string is an array of > characters). So if you changed the line: > elif a[0] == '-' and a[1:].isdigit(): > to : > elif len(a) > 1 and a[0] == '-' and a[1:].isdigit(): > > I expect you'll get what you want. >
Hi Shuying, thank you for your solution. /\ Vincent _______________________________________________ Tutor maillist - [email protected] http://mail.python.org/mailman/listinfo/tutor
