x = 1 while(x < 26) print(x) x = x + 1 There is an error in the while loop. What should be fixed? Add a colon to the end of the statement Begin the statement with the keyword count Change the parentheses around the test condition to quotation marks Use quotation marks around the relational operator

Respuesta :

Answer:

Add a colon to the end of the statement

Step-by-step explanation:

Given

x = 1

while(x < 26)

   print(x)

   x = x + 1

Required

Spot and fix the error

Every lines of the given code segment is correct except the second line.

The syntax of a while loop is:

while(condition):

Comparing while(condition): to while(x < 26),

we'll see that while(x < 26) has a missing colon.

So, the error in the program is a missing colon and the solution is (option a) adding a colon to the end of the while statement

So, the correct code segment is:

x = 1

while(x < 26):

   print(x)

   x = x + 1