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

How accurate was the cartoon in predicting the progress in the war?
A triangle has angles with the following measures: (x2 + 34)°, (6x + 4)°, and (10x + 10)°. Solve for x.
Why did ethnic serbs want to kill Francis ferdinard
Which word correctly completes the sentence? Kat’s grades were so good that she was already ________ herself as class valedictorian
In an opera theater, sections of seating consisting of 3 rows are being laid out. It Is planned so each row will be 2 more seats than the one before it and 90 p
what did Columbus call the natives and why?
I. Both use the archetype of Star-Crossed Lovers. II. In each story, the lovers are forbidden to see each other. III. Both stories involve children of royalty
Why does air pressure decrease as altitude increases?
Why are jury trials important to court cases like those of Felina Early v. Suzy Snoozer? Jury trials protect the right of the government to require suspect cit
Rezolve in natural numbers a) 3x + 5<3 (x+2) b) 4x+7>2(2x+5) c) 7x+41>2(3x+11) d) 18+10x<5(x+2)+2(x+3) Pls i neted fast