"elis aeris" <[EMAIL PROTECTED]> wrote 

> what do I do if i want the program/function to end?
> 
> in c++ of
> 
> int main(){}
> 
> I do a return 0;

Actually you don;t. In your e4xample yuou just have empty 
braces and that will end just fine! Similarly in Python it will 
just silently drop off the end of the code.

However if you want to return a value to the OS other 
than 0 you can use the exit function from the sys module.
(Or raise a SystemExit exception with an argument of 
the required error code)

sys.exit() is explained in the Simple Sequences topic 
of my tutorial.


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld


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

Reply via email to