# Python program to illustrate # not 'in' operator x = 24 y = 20 list = [10, 20, 30, 40, 50 ]; if ( x not in list ): print("x is NOT present in given list") else: print("x is present in given list") if ( y in list ): print("y is present in given list") else: print("y is NOT present in given list")
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter