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

Dominick lives 1 3/4 miles from his school.  If his mother drives him half the way, how far will Dominick have to walk to get to school?
Does every point lie in a quadrant?
which state of matter has the least amount of energy?
“The genetic code is universal.” Explain this statement.
The length of a diagonal of a cube with edge length 25cm
Explain how a species can evolve through natural selection.
the cafeteria has 45 square  tables that can be pushed together to form one long table for the lacrosse team's banquet. Each square table can seat one person on
which factor made the most difference in how agriculture affected the economies of the colonies?
The height of a rectangular prism with a 20 cm by 12 cm base and a 30 cm diagonal.find the unknown dimension
Write a system of equations with a solution (4,–3)