Jun-19-2020, 01:43 AM
In line 1 (Python) you input a value. If that value tests to True (anything other than 0), the loop proceeds. If the 0 is entered (False) the loop terminates. If the entered value is not a number you trip a ValueError.
That's the Python behavior. Can't vouch for the C++. Learned C but skipped C++ as each version seemed OS specific so moved to Java before Python.
That's the Python behavior. Can't vouch for the C++. Learned C but skipped C++ as each version seemed OS specific so moved to Java before Python.