About 10,600,000 results
Open links in new tab
  1. Why does range(start, end) not include end? - Stack Overflow

    Basically in python range(n) iterates n times, which is of exclusive nature that is why it does not give last value when it is being printed, we can create a function which gives inclusive value it …

  2. Print a list in reverse order with range ()? - Stack Overflow

    Sep 2, 2011 · Using "reversed" with python generator (assuming we ware talking of Python 3 range built-in) is just conceptually wrong and teaches wrong habits of not considering …

  3. python - How do I create a list with numbers between two values ...

    Aug 16, 2013 · How do I create a list of numbers between two values? For example, a list between 11 and 16: [11, 12, 13, 14, 15, 16]

  4. What is the difference between range and xrange functions in …

    range() in Python 2.x This function is essentially the old range() function that was available in Python 2.x and returns an instance of a list object that contains the elements in the specified …

  5. Python 3 turn range to a list - Stack Overflow

    Jul 14, 2012 · 275 I'm trying to make a list with numbers 1-1000 in it. Obviously this would be annoying to write/read, so I'm attempting to make a list with a range in it. In Python 2 it seems …

  6. iteration - How to loop backwards in python? - Stack Overflow

    I used range simply because the OP did. xrange vs range only matters for really large ranges, like hundreds of megabytes. Also, in Python 3.x, this distinction is gone.

  7. python - How can I access the index value in a 'for' loop? - Stack …

    The fastest way to access indexes of list within loop in Python 3.7 is to use the enumerate method for small, medium and huge lists. Please see different approaches which can be used to …

  8. python - How to stop one or multiple for loop (s) - Stack Overflow

    You'll need to complete a few actions and gain 15 reputation points before being able to upvote. Upvoting indicates when questions and answers are useful. What's reputation and how do I …

  9. python - How to set the axis limits in Matplotlib? - Stack Overflow

    One thing you can do is to set your axis range by yourself by using matplotlib.pyplot.axis. matplotlib.pyplot.axis from matplotlib import pyplot as plt plt.axis([0, 10, 0, 20]) 0,10 is for x …

  10. python - Concatenating two range function results - Stack Overflow

    Dec 31, 2012 · This is what range(5) + range(10, 20) exactly did in Python 2.5 -- because range() returned a list. In Python 3, it is only useful if you really want to construct the list.