Computer Science, asked by tn33604070404, 5 months ago

write a short note on python membership with suitable example

Answers

Answered by DisneyPrincess29
4

The membership operators in Python are used to test whether a value is found within a sequence. For example, you can use the membership operators to test for the presence of a substring in a string. Two membership operators exist in Python:

in – evaluates to True if the value in the left operand appears in the sequence found in the right operand. For example, ‘Hello’ in ‘Hello world’ returns True because the substring Hello is present in the string Hello world!.

not in – evaluates to True if the value in the left operand doesn’t appear in the sequence found in the right operand. For example, ‘house’ in ‘Hello world’ returns True because the substring house is not present in the string Hello world!.

Answered by GucciBoyTae
2

Mark the upper One as BRAINLIEST

Similar questions