Python Forum
Question on True expressions
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question on True expressions
#1
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'
Reply
#2
What have you tried? You could experiment at the Python console.
Reply
#3
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Statements and Expressions Julie 1 1,637 Feb-26-2021, 05:19 PM
Last Post: nilamo
  Regular Expressions pprod 4 3,089 Nov-13-2020, 07:45 AM
Last Post: pprod
  Returning True or False vs. True or None trevorkavanaugh 6 9,254 Apr-04-2019, 08:42 AM
Last Post: DeaD_EyE
  Regular Expressions amitalable 4 2,775 Mar-14-2019, 04:31 PM
Last Post: DeaD_EyE
  Using Generators and their expressions BeerLover 3 4,546 Mar-18-2017, 11:06 PM
Last Post: Ofnuts

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020