13.6k views
5 votes
Isla has just written a for loop that is supposed to print the numbers 1 through 10. When she runs it, the numbers 0 through 9 are printed. Which of the following is most likely her problem?

A.
She has forgotten to put a colon at the end of her loop statement.

B.
She has forgotten that Python begins counting at 0 instead of 1.

C.
She has not printed the correct variable.

D.
Only while loops can begin counting at 1 instead of 0.

User Aneika
by
7.5k points

1 Answer

2 votes

Answer:

C. She has not printed the correct variable

Step-by-step explanation:

When using ranges to count, you need to add +1 to the number you want to end on (she would have to write range(0, 11)). This is because the last number of the range isn't counted

User Riana
by
8.3k points

No related questions found