About 391,000 results
Open links in new tab
  1. Logical Operations on String in Python - GeeksforGeeks

    Nov 5, 2024 · Python considers empty strings as having a boolean value of the 'false' and non-empty strings as having a boolean value of 'true'. For the 'and' operator if the left value is true, …

  2. Python String Methods - W3Schools

    Searches the string for a specified value and returns the last position of where it was found: rjust() Returns a right justified version of the string: rpartition() Returns a tuple where the string is …

  3. Python String Methods - Logical Python

    Python String startswith() Method. To check if a string starts with a specified character(s). Returns True if the string starts with a specified character(s), else False.

  4. What's the logical value of "string" in Python? - Stack Overflow

    Dec 31, 2010 · In Python an empty string is considered False, True otherwise. You could use the in operator: if name in ("Kamran","Samaneh"): print("That is a nice name") else: print("You …

  5. string — Common string operations — Python 3.13.3 …

    3 days ago · check_unused_args (used_args, args, kwargs) ¶ Implement checking for unused arguments if desired. The arguments to this function is the set of all argument keys that were …

  6. 5 Best Ways to Evaluate Boolean Expressions from a String in Python

    Mar 9, 2024 · The challenge is to parse the string and reliably evaluate the expression within the constraints of Python’s syntax and logical operations. Method 1: Using eval() The eval() …

  7. if Statement With Strings in Python - Delft Stack

    Feb 22, 2025 · Python offers several advanced techniques for string comparison and manipulation that can be used with if statements. You can use the sorted() function to check if two words …

  8. Logical Operators on String in Python - Includehelp.com

    Apr 21, 2025 · Learn how Python logical operators (and, or, not) work with strings. Understand string evaluation in boolean context with practical examples.

  9. How to use logical operator with strings in Python

    Feb 6, 2022 · We can use the logical operators with strings in Python. We have three logical operators available: AND , OR and NOT . If you are familiar with these operators, you can use …

  10. How would I check a string for a certain letter in Python?

    Aug 25, 2024 · in keyword allows you to loop over a collection and check if there is a member in the collection that is equal to the element. In this case string is nothing but a list of characters: …

  11. Some results have been removed
Refresh