The error in the code is the condition in the while loop. It should be count < 6 instead of count > 6. Here is the corrected code:
count = 1
while count < 6:
print(count, "x", count, "=", count*count)
count += 1
The following code has a logic error. What code for the while loop will fix the error so that the code will loop five times?
count = 1
while count > 6:
print(count, "x", count, "=", count*count)
count +=1
1 answer