Hi Alan, I did not receive personally your last email but I have read it on
the forum.
OK i understand now what you were talking about, sorry it took such a long
time for me to see the solution, the good thing about it is that I am
learning tons.
I will probably post soon again once I hit a
OK Alan, I thing I have seen the light!!.
Almost. :-)
-
def print_options():
print --
print Options:
print a. print options
print f. quit the programme
OK Alan, I thing I have seen the light!!. Here is the script that Kent and
you asked me to look at modified:
-
def print_options():
print --
print Options:
print a. print options
Quoting John Carmona [EMAIL PROTECTED]:
Is it that if you use while 1: you create a recursive function? Hope I
am right.
No ...
Remember how functions can call other functions?
def add(x, y):
Add two integers together.
return x+y
def mul(x, y):
Multiply two integers together.
Hi Alan, sorry for not replying sooner I am right in the middle of setting
up a network at home. Thanks for your email.
OK the situation is that I haven't still found out what the answer is, I
have noticed in the other hand that if I select the option a let's say 4
times, I need to enter the
OK the situation is that I haven't still found out what the answer
is, I
have noticed in the other hand that if I select the option a let's
say 4
times, I need to enter the option f 4 times. I am curious to know
what the
solution is. I have read your chapter on recursion but that did not
clear
Thanks Kent, as far as I can see I get the same problem that on my script, i
need to enter f 3 to 4 times before I exit the programme. Hmmm, why, I
can't see it really, i thought that the fact to have the break command
would terminate the script straight away. If I enter f first then the
can't see it really, i thought that the fact to have the break
command
would terminate the script straight away.
break terminates the current loop, which is inside your print_options
function. print_options is called from inside print_options.
Research the term recursion and see if you can see
Thanks for the help Kent, Noel and Alan. Here is my final script (it seems
to be working ok but sometimes if I select quit the programme, I need to
enter that option 2 or 3 times before it works, is this a bug (I am running
Win XP), please feel free to comment if you thing that something could
John Carmona wrote:
Thanks for the help Kent, Noel and Alan. Here is my final script (it
seems to be working ok but sometimes if I select quit the programme, I
need to enter that option 2 or 3 times before it works, is this a bug
Try this program. Choose option a a few times, then choose f
10 matches
Mail list logo