Python Forum

Full Version: Question on True expressions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am new to Python and I am taking a course in Python. I have an expression that I do not understand what the answer should be. My instructor gave me the following to solve.

In Python, if we know Result is True, can you fill in the blank in this expression?

Result = ___ in 'ABC'
What have you tried? You could experiment at the Python console.
https://docs.python.org/3/library/stdtyp...uple-range Wrote:Sequence Types — list, tuple, range > Common Sequence Operations
x in s True if an item of s is equal to x, else False

Note:
While the in and not in operations are used only for simple containment testing in the general case, some specialised sequences (such as str, bytes and bytearray) also use them for subsequence testing:

>>>
>>> "gg" in "eggs"
True