Hello,
you can refactor your code a little bit and learn more about exceptions:
def get_numbers():
first = None
second = None
while True:
try:
if first is None:
first = int(input('Enter your first number: '))
if second is None:
On 08/06/17 00:56, CB wrote:
Hi everyone,
I am taking a python class and I'm stuck in an exercise.
what am i doing wrong? Can anyone try to run it? Thanks so much!
It helps if you describe what is going wrong. Not just us, either;
"Teddy Bear Debugging", explaining to a colleague (or indeed
On Thu, 8 Jun 2017 09:56 am, CB wrote:
> Can anyone try to run it?
Yes, you can.
Doctor to patient: "So, what seems to be the problem?"
Patient: "You're the doctor, you tell me."
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.
On 2017-06-08 00:56, CB wrote:
Hi everyone,
I am taking a python class and I'm stuck in an exercise.
what am i doing wrong? Can anyone try to run it? Thanks so much!
#Description:Input validation and while loops.
import random
def main(): #main function need in all programs for automated test