On 19-4-2019 16:37, Tamara Berger wrote:
Hi Python-List,

What code can I use to break out of a program completely, and not just out
of a loop? I wrote code with 3 conditions for saving for a downpayment. The
first addresses cases that don't meet the minimum condition; i.e., enough
money to save for a downpayment within the allotted time. It has its own
print line, but also executes the irrelevant print lines for the other two
conditions.

Thanks,
Tamara


cond1 = 1;
cond2 = 1;
cond3 = 1;

if cond1:
  if cond2:
    if cond3:
      print("All OK")
    else:
      print("cond3 NOK")
  else:
    print("cond2 NOK")
else:
  print("cond1 NOK")



--
Luuk
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to