Computer Science, asked by samriddhi11april, 5 months ago

. Which of the following sequences would be generated between the given line of code? range (5, 0, -2)

i. 5 4 3 2 1 0 -1

ii. 5 4 3 2 1 0

iii. 5 3 1

iv. None of the above​

Answers

Answered by pinnampaone25
6

Answer:

iii. 5 3 1

Explanation:

range(start, stop, step)

range() takes mainly three arguments having the same use in both definitions:

start - integer starting from which the sequence of integers is to be returned

stop - integer before which the sequence of integers is to be returned.

The range of integers ends at stop - 1.

step (Optional) - integer value which determines the increment between each integer in the sequence

Answered by utsrashmi014
0

Explanation:

  • range (start, stop, step)
  • range () takes three main arguments has the same usage in both definitions: 6
  • Start-an integer that returns a sequence of integers
  • Stop-integer before Returns a sequence of integers.
  • The range of integers ends with a stop-1.
  • Step -An integer value that determines the increment between each integer in the sequence.

Hence the answer will be option (ii) 5 3 1

#SPJ2

Similar questions