About 50 results
Open links in new tab
  1. In python, what does len(list) do? - Stack Overflow

    Apr 27, 2016 · I am 99.9% positive that any sequence type in higher-level languages will store its length. The len (or strlen or length) functions in Python, Perl, and Ruby (and other such …

  2. python - What does "len (A) - 1" mean? - Stack Overflow

    May 10, 2018 · I mean, another answer is that it's the length of the iterable minus 1, or the amount of elements in a list minus 1, but the question is: what is really the question.

  3. python - How does len work? - Stack Overflow

    Aug 19, 2013 · You won't be able to. At least if you want it to work with the rest of python. See the Called to implement the built-in function len (). Should return the length of the object, an …

  4. Why does Python code use len() function instead of a length …

    Oct 26, 2008 · The protocol in Python is to implement this method on objects which have a length and use the built-in len() function, which calls it for you, similar to the way you would …

  5. 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 …

  6. How does len() function work in python - Stack Overflow

    Jun 27, 2018 · 0 Indexes start from 0 in python, so if for example Mymessage has a value of 'hello', then range(len(Mymessage)) will produce an iterator that counts from 0 to 4 because …

  7. Why we use range (len) in for loop in python? - Stack Overflow

    Nov 18, 2018 · Therefore in such cases you won't get around using the range over the list's len or similar, so that's not un-pythonic by defintion. Last but not least, a good combination if you …

  8. python - What is the meaning of range and len in my code

    May 28, 2020 · 0 len() gives you the size of the iterable, so in this case len(ppn.errors_) is the size of the vector (number of elements/dimensions). range(a,b) will give you a range of numbers …

  9. What does %s mean in a Python format string? - Stack Overflow

    Actually that PEP says "In Python 3.0, the % operator is supplemented by a more powerful string formatting method" and that it is backported to Python 2.6. Where I come from "supplemented" …

  10. python - What does "sys.argv [1]" mean? (What is sys.argv, and …

    from __future__ import print_function import sys print(sys.argv, len(sys.argv)) The script requires Python 2.6 or later. If you call this script print_args.py, you can invoke it with different …