At Westonci.ca, we provide clear, reliable answers to all your questions. Join our vibrant community and get the solutions you need. Get immediate answers to your questions from a wide network of experienced professionals on our Q&A platform. Get immediate and reliable solutions to your questions from a community of experienced professionals on our platform.

Write an expression that evaluates to True if the string associated with s1 is greater than the string associated with s2

Sagot :

Answer:

Explanation:

The following code is written in Python. It is a function that takes two string parameters and compares the lengths of both strings. If the string in variable s1 is greater then the function returns True, otherwise the function returns False. A test case has been provided and the output can be seen in the attached image below.

def compareStrings(s1, s2):

   if len(s1) > len(s2):

       return True

   else:

       return False

print(compareStrings("Brainly", "Competition"))

View image sandlee09