About 50,800,000 results
Open links in new tab
  1. Python String Length - W3Schools

    To get the length of a string, use the len() function. The len() function returns the length of a string: a = "Hello, World!" Well organized and easy to understand Web building tutorials with lots of …

  2. How to get the size (length) of a string in Python

    Aug 31, 2023 · Do you want to find the length of the string in the Python language? If you want to find the length of the word, you can use the len function. string = input("Enter the string: ") …

  3. Using the len() Function in Python – Real Python

    Nov 16, 2024 · To find the length of a list in Python, you pass the list to len(), like len([1, 2, 3]). The len() function operates in constant time, O (1), as it accesses a length attribute in most …

  4. Find Length of String in Python - GeeksforGeeks

    Dec 3, 2024 · In this article, we will learn how to find length of a string. Using the built-in function len() is the most efficient method. It returns the number of items in a container.

  5. How to Use Python’s len () Method - Python Central

    Python's len() method can be used to easily find the length of a string. It's a simple and quick way to measure the length of a string (the number of characters) without having to write a lot of code.

  6. Python string length - GeeksforGeeks

    Oct 15, 2024 · In this article, we will see how to find the length of a string using the string len () method. Example: len (string) String: string of which you want to find the length. It returns an …

  7. Python: Input validate with string length - Stack Overflow

    Mar 7, 2014 · phone = int(input("Please enter the customer's Phone Number.")) If you want to check also that the input is a number and not text, you should also trap the exception raised by …

  8. What is len() in Python? How to Use the len() Function to Find the ...

    Feb 24, 2022 · In this article, I'm going to show you how to get the length of a string with the len() function. Basic Syntax for len() in Python. To use the len() function to get the length of a data …

  9. Checking the Length of a String in Python

    Jun 19, 2023 · Here’s how you can check the length of a string in Python: The most straightforward way to get the length of a string is by using the built-in len() function. This …

  10. Get the length of a string (number of characters) in Python

    Aug 21, 2023 · In Python, you can get the length of a string (str), i.e., the number of characters, using the built-in len() function. See the following article on how to count the number of specific …

  11. Some results have been removed
Refresh