About 328,000 results
Open links in new tab
  1. Python Return Boolean Value - W3Schools

    Python also has many built-in functions that returns a boolean value, like the isinstance() function, which can be used to determine if an object is of a certain data type:

  2. Beginner question: returning a boolean value from a function in Python

    Nov 12, 2010 · I'm trying to get this rock paper scissors game to either return a Boolean value, as in set player_wins to True or False, depending on if the player wins, or to refactor this code entirely so that …

  3. bool () in Python - GeeksforGeeks

    Feb 21, 2025 · In Python, bool() is a built-in function that is used to convert a value to a Boolean (i.e., True or False). The Boolean data type represents truth values and is a fundamental concept in …

  4. How to return boolean from function - LabEx

    Learn how to effectively return boolean values in Python functions, explore boolean logic techniques, and improve your coding skills with practical examples and best practices.

  5. bool () | Python’s Built-in Functions – Real Python

    The built-in bool() function allows you to determine the truth value of any Python object. It returns True or False, based on whether the object is considered truthy or falsy in Python:

  6. How to Use a Boolean in Python? (With Examples) - Cherry Servers

    Jul 29, 2024 · There are mainly two ways to use Boolean in Python functions. The first option is to use Boolean values as parameters for functions and the second option is to use them as return values …

  7. Python Return Boolean (True/False) From Function - Finxter

    Oct 14, 2022 · A Python function can return any object such as a Boolean value (True or False). To return a Boolean, you can have an arbitrary simple or complex expression within the function body …

  8. The Ultimate Boolean in Python Tutorial - Simplilearn

    Oct 9, 2024 · The bool () method in Python returns a boolean value and can be used to cast a variable to the type Boolean. It takes one parameter on which you want to apply the procedure.

  9. Python Boolean Expressions: A Comprehensive Guide

    Mar 29, 2025 · Many built-in functions in Python return boolean values. For example, the isinstance() function checks if an object is of a certain type and returns a boolean. This will print True because …

  10. Built-in Types — Python 3.14.2 documentation

    2 days ago · Operations and built-in functions that have a Boolean result always return 0 or False for false and 1 or True for true, unless otherwise stated. (Important exception: the Boolean operations or …