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 function does this graph represent: y=x-4; y=-x+4;y=4x-1;y=-4x+1
Thalidomide and l-dopa, shown below, are examples of pharmaceutical drugs that occur as enantiomers, or molecules that _____.
Exposing people to stereotype-consistent information before meeting with an individual from the stereotyped group is often sufficient to produce stereotypic int
The united states uses 24% of the world's supply of energy. What fraction of the world's energy is this???
Elise built a rectangular vegetable garden that is 9 feet long and has an area of 72 square feet. What is the perimeter of Elise’s vegetable garden?
The value of each variable
Which feature of an object affects its weight? Check all that apply. A. mass of the object B.shape of the object C.location of the object D.how much energy
Give reason why wood is solid?
The process of building the french monarchy began when _______ was chosen to be king of france.
Someone help me with this please