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

results of 1+2+3+....+99+100+99+...+3+2+1 is.....
If you know two points on a line, how can you find the rate of change of the variables being graphed?
Lily and julian start with the same number. Lily works out half the number and Julian works out 3 quarters The sum of their answers in 275 What was the startin
written in simplest form, the expression (x^2)(y^2)-9 over 3-xy is equivalent to 1. -1 2. 1 over 3+xy 3. -(3+xy) 4. 3+xy Please show work
How long does interphase last?
How do you write 1.075 in 2 other forms?
1. Compare the location of electrons in an atom based on Bohr's theory with the location of electrons in an atom based on the current atomic theory. 2. Rutherf
by hw much is the difference of 604 and 406.64 less than thier sum ?
Can someone help solve, 3y+6=30-7y
What phylum has animals with a central cavity and mouth;and most of them have tentacles?