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 wa
> OK Alan, I thing I have seen the light!!.
Almost. :-)
>
-
> def print_options():
>print "--"
>print "Options:"
>print "a. print options"
>print "f. quit the prog
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 inte
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 opt
> 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 no
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
> 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 ca
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
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 enou
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 Kent, it is working now. Is this what you meant in your reply?
Because if I set up the main code at the end of the script I was still
getting an error message.
Yes, that's what I meant, though you just need
task_options()
rather than
print task_options()
When you say pr
On Apr 23, 2005, at 15:44, John Carmona wrote:
Thanks Kent, it is working now. Is this what you meant in your reply?
Because if I set up the main code at the end of the script I was still
getting an error message.
Also, what do I need to use if for example I want my code to rerun
once I have co
Thanks Kent, it is working now. Is this what you meant in your reply?
Because if I set up the main code at the end of the script I was still
getting an error message.
Also, what do I need to use if for example I want my code to rerun once I
have computed let's say a volume. Right now the execut
13 matches
Mail list logo