- Home
- Course Detail
regularpython@gmail.com
You are now watching:
Python Operators / of Python Membership Operators Basic Examples
fruits_bucket = "dnfjkndsjfngrapes" # In operator if 'apple' in fruits_bucket: print('apple available in fruits_bucket') if 'grape' in fruits_bucket: print('grapes are available in fruits_bucket') else: print('grapes are not available in fruits_bucket') # ======================================================== # Not In Operator. if 'Tomota' not in fruits_bucket: print('Tomota not available in fruits_bucket') else: print('Tomota available in fruits_bucket')