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

Which component of skill-related fitness would most help a shot-putter increase the distance of his or her throw? -speed -balance -agility -power
What's bigger 8/15 or 11/20 (fractions)
Tomorrow, the mayor will announce her plans "for the new committee." what type of phrase is this?
What is the value of the 4 in 6.54
what characteristics do tragric heroes share?
how do landforms affect human life
what might cause an ecosystem not to return to its original climax community after a disturbance
What is one advantage of using a computer over a graphing calculator?
In the body of cells of most organisms oxygen is used to release what ?
Describe how insulation works and the role it plays in keeping our homes at a comfortable temperature.