About 50 results
Open links in new tab
  1. How does the Python's range function work? - Stack Overflow

    The Python range() function simply returns or generates a list of integers from some lower bound (zero, by default) up to (but not including) some upper bound, possibly in increments (steps) of some other …

  2. Syntax for range function in Python - Stack Overflow

    Dec 9, 2022 · The range function in Python has the syntax range (start, stop, step) and generates a sequence of numbers starting from start, up to but not including stop, with a step size of step.

  3. Python range function - Stack Overflow

    Say I want to loop from 0 to 100 but with a step of 1/2. If you try for i in range(0, 100, 0.5): whatever Error: the step must not be 0 Question: Is there any built-in way in Python 2.x to do

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

    Jul 14, 2012 · In Python 2, people tended to use range by default, even though xrange was almost always the better option; in Python 3, you can to explicitly opt in to the list, not get it by accident by …

  5. python range and for loop understanding - Stack Overflow

    Mar 26, 2022 · 0 I am new to python / coding and looking to understanding the range function more and how it is used in conjunction with the "for" loop. So I know that the range function takes in 3 …

  6. How do I use a decimal step value for range ()? - Stack Overflow

    My versions use the original range function to create multiplicative indices for the shift. This allows same syntax to the original range function. I have made two versions, one using float, and one using …

  7. Range function Python - Stack Overflow

    Nov 17, 2013 · 1 i'm new to Python but learning with up's and downs. I don't understand this bit of code: To iterate over the indices of a sequence, combine range () and len () as follows:

  8. 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 memory/processing …

  9. python - range () for floats - Stack Overflow

    Dec 6, 2015 · 7 I helped add the function to the package . more_itertools.numeric_range(start, stop, step) acts like the built in function range but can handle floats, Decimal, and Fraction types.

  10. loops - Using range function in Python - Stack Overflow

    Jul 22, 2021 · I am new to learning Python and have a question about using the range function to iterate a string. Let's say I need to capitalize everything in the following string ...