7.7. The in
operatorΒΆ
The word in
is a boolean operator that takes two strings
and returns True
if the first appears as a substring in the
second:
- True
- Correct! in is a boolean operator that takes two strings and returns True if the first is part of the second.
- False
- Incorrect! in is a boolean operator. Try again.
11-9-2: True or False? The word in
is a boolean operator.
- True
- Correct! This returns True because there is a string 'i' within the string 'lime'.
- False
- Incorrect! There is an 'i' in lime, so this will return True. Try again.
11-9-3: True or False? The following code returns True.
'i' in 'lime'
- True
- Correct! This returns True because there is a string 'hat' within the string 'chatter'.
- False
- Incorrect! The string 'chatter' contains the substring 'hat'. Try again.
11-9-4: True or false? The following code returns True.
'hat' in 'chatter'
You have attempted of activities on this page