Code

'not in' operator

The examples shown below work with lists named my_list containing the following items/elements 1, '1cademy', 12.59, True.

The operator ' not in ' returns true if the particular item is not in the list otherwise false.

  • Example for not in operator  
1 not in my_list

output

False
  • Example for not in operator  
12.5 not in my_list

output

True

0

1

Updated 2021-03-25

Tags

Python Programming Language

Data Science