Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Introducing Lists Using Lists Iteration

mohan Abdul
PLUS
mohan Abdul
Courses Plus Student 1,453 Points

How do you use '''in''' function to see if a string is inside another string?

How do you use '''in''' function to see if a string is inside another string? could you please use python script to show me where you use back ticks ```

1 Answer

Steven Parker
Steven Parker
230,970 Points

You don't see them, but the line after this one has 3 backticks followed by the word python to cause the code after it to be formatted and get syntax coloring :point_down:

py = "Python is a powerful language"
# here is an example of using the "in" operator
if "pow" in py:
    print("The sentence has 'pow' in it!")

:point_up: The line above this one has just 3 backticks (which also won't show), but doesn't the code look nice?