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

what is 12/75 simplest form
Round 803,119 to the nearest hundred
What fighting methods did the colonists use against the British troops marching back to Boston from Concord?
what will happen without protection of human rights
the grinding away of rock by another rock particles is called what
Angela earns $6.25 per hour babysitting. Estimate how much she will earn if she babysits for 9 hours this weekend. Explain.
list the units from most precise to least precise
what will happen without protection of human rights
If you're currently earning $9.25 per hour and you received a 4% increase, what would be your new hourly rate
what is the purpose for an organizational structure in health care facility