About 50 results
Open links in new tab
  1. How to get the size (length) of a string in Python

    "what function can i use to calculate the size of the string"? What tutorial are you using to learn Python? Please update the question with some information on where and how you're learning Python.

  2. Why does Python code use len () function instead of a length method ...

    Oct 26, 2008 · I know that Python has a len() function that is used to determine the size of a string, but why is it not a method of the string object?

  3. function - How to calculate the length of the string in python - Stack ...

    Aug 22, 2017 · How to calculate the length of the string in python Asked 8 years, 6 months ago Modified 5 years, 6 months ago Viewed 29k times

  4. python - String length without len function - Stack Overflow

    How can I get the length of a string without using the len() function or any string methods?

  5. python - Cost of len () function - Stack Overflow

    Jul 12, 2009 · For any of the built-in types, len(x) doesn't need to perform a dict lookup on CPython; the length getting function is stored in a dedicated slot in the PyTypeObject struct, that can be looked up …

  6. Sorting Python list based on the length of the string

    Decorate-Sort-Undecorate Design Pattern : Python’s support for a key function when sorting is implemented using what is known as the decorate-sort-undecorate design pattern. It proceeds in 3 …

  7. python - How do I apply this string length function to a column in my ...

    Mar 20, 2019 · 2 The function prompts the user for some input. This won't work if you apply it to a dataframe. You can however apply the built-in len () function:

  8. python - How do I pad a string with zeros? - Stack Overflow

    How do I pad a numeric string with zeroes to the left, so that the string has a specific length?

  9. Length of a string using conditionals (using Python)

    Jul 22, 2020 · @zvone hi, yes i am trying to learn about Python. I was trying out few conditional statements to try to calculate the length of string. If the input is string data type, then it should return …

  10. python - Repeat string to certain length - Stack Overflow

    Pillmod's / Pillmuncher's code is more beautiful, but unfortunately slower than Scheirer's code, because adding to an already long string is an expensive operation (the Python runtime will have to copy the …