Search code examples
pythonlistusing

when I run this code below, it doesn’t give me True or False


it doesn’t give an output and I Know that the output should be True or False

some = [1, 9, 21, 3]
9 in some

Solution

  • As others have pointed out, you need to do something with the result. You can save it into a variable with:

    var = 9 in some
    

    or print it directly with:

    print(9 in some)