About 18,200,000 results
Open links in new tab
  1. Python Strings (With Examples) - Programiz

    In Python, a string is a sequence of characters. For example, "hello" is a string containing a sequence of characters 'h', 'e', 'l', 'l', and 'o'. We use single quotes or double quotes to represent a string in Python. For example, Here, we have created a string variable named string1.

  2. Python Strings - W3Schools

    Strings in python are surrounded by either single quotation marks, or double quotation marks. 'hello' is the same as "hello". You can display a string literal with the print() function: You can use quotes inside a string, as long as they don't match the quotes surrounding the string:

  3. Python String - GeeksforGeeks

    Mar 10, 2025 · Python provides a various built-in methods to manipulate strings. Below are some of the most useful methods. len (): The len () function returns the total number of characters in a string. upper () and lower (): upper () method converts all characters to uppercase. lower () method converts all characters to lowercase.

  4. String Manipulation in Python - PythonForBeginners.com

    Jun 10, 2023 · To manipulate strings, we can use some of Pythons built-in methods. To create a string with given characters, you can assign the characters to a variable after enclosing them in double quotes or single quotes as shown below. Output: In the above example, we created a variable word and assigned the string "Hello World" to the variable.

  5. Working with Strings in Python 3 - GeeksforGeeks

    Apr 7, 2025 · Python offers a powerful feature called f-strings (formatted string literals) to simplify string formatting and interpolation. f-strings is introduced in Python 3.6 it provides a concise and intuitive way to embed expressions and variables directly into strings.

  6. Python String Fundamentals: A Guide for Beginners

    Feb 19, 2024 · In Python, text data is represented by the string data type. It’s one of the basic built-in data types, so knowing how to work with strings in Python efficiently is key to becoming a good programmer. In this article, we’ll show you Python string fundamentals with plenty of hands-on examples. Python has many built-in data types.

  7. 7. Input and Output — Python 3.13.3 documentation

    2 days ago · To use formatted string literals, begin a string with f or F before the opening quotation mark or triple quotation mark. Inside this string, you can write a Python expression between { and } characters that can refer to variables or literal values. The str.format() method of strings requires more manual effort.

  8. Python String: Working With TextPython Land Tutorial

    Mar 14, 2025 · Learn what a Python string is, how to create strings, which quotes to use when creating them, and how to perform operations on a string.

  9. Strings and Character Data in Python – Real Python

    Dec 22, 2024 · Python strings are a sequence of characters used for handling textual data. You can create strings in Python using quotation marks or the str() function, which converts objects into strings. Strings in Python are immutable, meaning once you define a string, you can’t change it. The str() function converts objects to their string representation.

  10. Python String Methods - GeeksforGeeks

    Jan 2, 2025 · Here is the list of in-built Python string methods, that you can use to perform actions on string: Pad the string with the specified character. Returns the number of occurrences of a substring in the string. Note: For more information about Python Strings, refer to …

  11. Some results have been removed