asked 49.5k views
20 votes
Identify the error in the following block of code.

for x in range(2, 6):
print(x)
A. The first line is missing quotes.
B. The first line has a spelling error.
C. The second line has a spelling error.
D. The second line needs to be indented four spaces

2 Answers

5 votes
D I had this question
answered
User WaTeim
by
8.9k points
5 votes

Answer:

D.The second line needs to be indented four spaces

Step-by-step explanation:

Since the print statement is not indented, it is not part of the for loop. This means that there are no lines of code to be executed in the for loop, so this will cause an error.

answered
User Vav
by
8.3k points

No related questions found