Ask Question
31 July, 03:42

Use the line of code below to choose the correct answer. while (count < 7) : print 'Great!' This code is an example of a (n)

+4
Answers (1)
  1. 31 July, 07:38
    0
    infinite loop

    Explanation:

    A loop is a portion of code that is repeated a number of times, based on a condition that is evaluated at the beginning (or end, depending the structure chosen) of the loop.

    If the condition is evaluated as true, then the code is executed.

    Normally, within the looped code or within the test itself, there will be some changes done to the test variable value to make it run only the desired number of times.

    If a code doesn't alter the test variable value, and the test is true, the loop will execute indefinitely because it will never never encounter a false value to stop it. That's called an infinite loop, and it's a big programmer's mistake.

    That's the case with this line of code. If seen as is alone, there's no change of value of the 'count' variable ... so it will either never run (if count > 6) or will run continuously (if count < 7).
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Use the line of code below to choose the correct answer. while (count < 7) : print 'Great!' This code is an example of a (n) ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers