I am learning Python and have written several small programs of increasing
complexity but so far they are all "linear" programs meaning that they are
meant to do one thing.  I have yet to fully understand program control in
order to go to and return form modules (I think this is the correct term).
In other words, I have a menu which offers several options, I would like to
be able to combine several of my programs into seperate modules and put in
one larger program.  Then the user could select a menu item, be sent to a
module and return to the menu for another selection.  Can someone show me
how to do module or program control to accomplish the basic example below:

Main Menu
Select 1 for subtraction
Select 2 for addition
Select 3 to quit

***********************************
Subtraction module:
Enter a number
Enter a second number
Answer =Number1-Number2

Menu:

Select 1 to return to main menu
Select 2 to subract again

************************************
Addition module:
Enter a number
Enter a second number
Answer = Number1+Number2

Menu

Select 1 to return to main menu
Select 2 to add again
********************************************
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to