At 06:55 PM 7/30/2005, Nathan Pinno wrote:
...
elif cal_opt == 4:
X = input("First
number:" )
Y = input("Second
number:" )
if Y == 0:
print
"Division by zero ot allowed!"
Y =
input("Second number:" )
else:
print
X, "/", Y, "=
Thanks Todd. Can you please look at my other messages that you haven't
answered, and see what's wrong with them, or what the answer is.
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Saturday, July 30, 2005 8:10 PM
Subject: Re: [Tutor] When I run this cod
Looks like you are making some pretty good progress.
The short answer to your question is that the menu & user input need to be
inside the while loop. That way cal_opt has a chance to change value before
it gets evaluated by the while loop again.
Another comment - the global cal_opt is conside
When I run the following code it just keeps repeating. Here is a screen
shot showing what I mean:
Mini CalculatorBy Nathan Pinno
CALCULATE MENU1) Add2) Subraction3) Multiplication4)
Division w/o remainder5) Division with remaider6) Exponation7)
Square roots9) ExitOption: 5First number:4Seco