samsmadelyn453 samsmadelyn453
  • 03-07-2021
  • Computers and Technology
contestada

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

Respuesta :

sandlee09
sandlee09 sandlee09
  • 04-07-2021

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"))

Ver imagen sandlee09
Answer Link

Otras preguntas

The lithospheric plates move an average of
The GCF of two numbers is prime. The LCM of the two numbers
Identify the type of clause used in this sentence. Some people who can carry a tune are very shy. noun clause adverb clause
What happened in Belgium 1831
use what you know about odysseus and how he has changed over the course of his journey to explain how the theme “true strength is knowing when not to act” is sh
What is the solution to x? I have to show my work...
In James Joyce's "Araby," the narrator uses light and dark imagery to set the tone and mood of the story and also to describe the nature of life on the street o
What is the Triassic extinction?
Which era spanned from 600 C.E to 1500 C.E?
I have these questions I need to find the acceleration, Please explain how to do them, Don't have to explain all xD 1. Change in speed = 14 m/s; time taken = 2