Application Development using Python (18CS55) VTU Questions and Solutions - 2
1. Explain in and not operator in string with suitable examples. Ans : in and not in are membership operators. in operator. The in operator in Python checks whether a specified value is a constituent element of a sequence like string, array, list, or tuple etc. When used in a condition, the statement returns a Boolean result evaluating into either True or False. When the specified value is found inside the sequence, the statement returns True. Whereas when it is not found, we get a False. The ‘not in’ operator is the complement of in. [02] a in calendar z in calendar a not in calendar z not in calendar True False False ...