Re: [Tutor] menu based programs

2015-01-17 Thread Alan Gauld
On 17/01/15 02:00, Alan Gauld wrote: Here is a very simple example modelled on your description # def readMenu(menu): while not (1<= choice <= len(menu) ): for index, item in enumerate(menu,start=1): print (index, item) choice = input("\nchoo

Re: [Tutor] menu based programs

2015-01-16 Thread Alan Gauld
On 16/01/15 23:39, Siya 360 wrote: i want to learn how to write code to interact with the user, > in a sequence where > if option 1, then display a, > if 2 then display b, > if 3 display c, > if 4 display exit, if 1 selected, leads to option a, which in turn has it own options You don't say

[Tutor] menu based programs

2015-01-16 Thread Siya 360
Hi, Am still learning Python, and i have been tasked with writing a used menu, where once session is initialised by user inputing a used code e.g. *123#, it displays menu to user with option i want to learn how to write code to interact with the user, in a sequence where if option 1, then disp