209k views
5 votes
Use the line of code below to choose the correct answer. while (count < 7): print ‘Great!’ This code is an example of a(n)

User Danmine
by
7.4k points

2 Answers

3 votes

Answer:

single statement suite

Step-by-step explanation:

User Gilles Gregoire
by
8.4k points
6 votes

Answer:

infinite loop

Step-by-step 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).

User Mizuki Nakeshu
by
7.2k points