Menu
Coddy logo textTech

How to test?

Lesson 15 of 19 in Coddy's Into the Past || Complete Beginner for Python Strings course.

In this section we will learn about equivalence; what is it used for and why you need it.  In python we use testing to get a True or False answer.  The True or False answers are called Booleans.  We will uses these answers more later.  The testing we are going to be using are called equivalence.  You test equivalence with the double equal signs like so

==

The way this works is 

is this == to this or, is this the same as this

Example:

"Sam" == "Sam" --> True

This comparison test is testing if one string is the same as the other.  Since they are the same the comparison returns True

challenge icon

Challenge

Easy

Now run the code that is given to you in the code editor and see for yourself

Try it yourself

def first(s):
    return s[0] == "T"

All lessons in Into the Past || Complete Beginner for Python Strings