0

I'm doing an assignment and in one of the questions, my professor put some strange pseudo code as a condition and frankly I'm not sure if I understood it correctly.

This is what he gave us:

LOOP if S>0 then {S:=S-1; exit} end_if;
END_LOOP

can I understand this as

while True:
    if S>0:
        S = S - 1
        break

if I were to rewrite it in Python?

Or, should it be like this?

while S>0:
    S = S -1
    break
yhware
  • 502
  • 3
  • 13
  • 26

1 Answers1

-2

It's not 100% clear, but given that the first version will either go around once, or go around forever, it's likely to be the second one.

AMADANON Inc.
  • 5,753
  • 21
  • 31