Posts tagged class
Using magic method __contains__
- 07 September 2023
Python is a high level language and allows you to do a lot of things with ease. One of the things that Python allows you to do is to check if an item is present in a list or tuple for example. This is done using the in
operator as shown below.