rylan8394 rylan8394
  • 01-02-2018
  • Computers and Technology
contestada

Given the variables name1 and name2, write a fragment of code that assigns the larger of their associated values to first.

Respuesta :

Kalahira
Kalahira Kalahira
  • 14-02-2018
We can compare strings like numbers,
 if "a" > "b":
   do something
   Solutions will be

   Python:
  first = max(name1, name2)
 second = min(name1, name2)

   Or if we are not supposed to use max() and min(), we can achieve the same thing with a conditional,
 Python:
  if name1 > name2: ...
Answer Link

Otras preguntas

Most one-party systems are associated with. A.Dictatorships B.Monarchies C.Democracies
Does magma form deep beneath earth's surface?
Suggest an environmental reason why the percentage efficiency of the motor should be high as possible?
Complete the sentence: -7 is greater than -12 because -7 lies to the ____ of -12 on a number line.
Which section of a company handles things like hiring, firing, and benefits? a. Information technology b. Sales c. Human resources d. Marketing Please selec
The demesne is the best land on the manor. a. True b. False
What is the opposite of disputing
Tennis Garden is 5 yards long how long is her garden in feet
Did the europeans treat african fairly
What is the meaning of the underlined phrase in this excerpt from Sonnet 126 by William Shakespeare? O thou, my lovely boy, who in thy power Dost hold Time's fi