Python Forum
While loop in Python and C++
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
While loop in Python and C++
#6
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.
Reply


Messages In This Thread
While loop in Python and C++ - by smjt2000 - Jun-18-2020, 07:41 PM
RE: While loop in Python and C++ - by Larz60+ - Jun-18-2020, 08:46 PM
RE: While loop in Python and C++ - by bowlofred - Jun-18-2020, 09:08 PM
RE: While loop in Python and C++ - by deanhystad - Jun-18-2020, 09:14 PM
RE: While loop in Python and C++ - by smjt2000 - Jun-18-2020, 09:16 PM
RE: While loop in Python and C++ - by jefsummers - Jun-19-2020, 01:43 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020