Clive wants to print the numbers 1 through 10, so he uses the following code.

for x in range(10):

print(x)

Why will he not get the output he wants?

1.Only the number 10 will print because he has only put 10 inside the parenthesis.

2.Python begins counting at 0, so the numbers 0 through 9 will print.

3.He will get a syntax error because he did not capitalize ‘For.’

4.Python begins counting at 0, so the numbers 0 through 10 will print

Respuesta :

If Clive wants to print the numbers 1 through 10 with the code:

for x in range(10):

    print (x)

He will not get the output he wants because python begins counting at 0, so the numbers 0 through 9 will print.

Code explanation

The code is represented in python.

  • We loop through the number in the range 10.
  • Then print the the looped numbers.

Generally, python begins counting from 0. Therefore, the numbers that will be printed are as follows:

  • 0
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

learn more on python here: https://brainly.com/question/26104476?referrer=searchResults

Ver imagen vintechnology