Ask Question
17 November, 00:34

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

+3
Answers (1)
  1. 17 November, 03:59
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers