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

NH4Cl + AgNO3 → AgCl + NH4NO3
solve for x -[tex]\bold{x {}^{2} - 4 = 0}[/tex]ty! ~​
(basic algebra) please help me with question:
Which inference can a reader make from the information in the passage? No one in Libby Prison hospital paid much attention to this tiny, birdlike woman with a t
The graph below represents which system of inequalities Y≤-2×+3 Y≤x+3 y≥-2x+3 2 ≥x+3 Y ≤3x+2 Y ≤-x+2 Y >2x+3 Y >x+3
W+15x-9y+2z Terms: Coefficients:
Based on his address to the Joint Session of Congress and your understanding of the historical context surrounding the speech, which of the following principles
what are the importance of computer software​
A hiking club is planning a hike in the mountains. They estimates that it will take 3.5 hours to walk 6km. How long will it takes the group to walk 24km?
which statement is true about the function?​