Hi Vincent,

> the program works with any input except when you just hit the enter key.


To be  able to understand why is the crash, take a look at what the 
interpreter tells you:

 >  File "untitled.py", line 12, in ?
 >    elif a[0] == '-' and a[1:].isdigit():
 > IndexError: string index out of range

IndexError is raised whan you try to access an element in a list or 
string, an element that does not exist. In the case where you only press 
enter, what is the content of a???? How many characters? (hint, you may 
try to

print a

before any evaluation...

Hope that gets you going,

Hugo
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to