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

Why did the Chinese peasants rebel against the manchus from 1850 to 1864?
Write good insulators around the home
convert to vertex form. y=2x^2+14x-4
A certain animal in the zoo has consumed 39 pounds of food in six days. If it continues to eat at the same rate, in how many more days will its total consumptio
15 times what equals 45
which accurately describes a tangent
In minks, the gene for brown fur (B) is dominant to the gene for silver fur (b). Which set of genotypes represents a cross that could produce offspring with sil
The Earth has a radius of 6,400 kilometers. A satellite orbits the Earth at a distance of 12,800 kilometers from the center of the Earth. If the weight of the s
reduce 15 1/4 +1 1/2 +3/20 to lowest term.
type the requested verb form of this verb. future progressive tense: soar