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 ancient Mesoamerican civilization were known for large stone monuments? a. the Aztec b. the Olmec c. the Maya d. the Inca
what is 4/20 simplified
what is the base or root word of inhospitable
Which statement accurately describes the homestead act of 1862?
complete the standard form of the equation -4y=3-2y.
A serum is being given to a patient to desensitize the patient for allergies. Each week the dosage is increased by 0.01 centiliters (cL). If the patient receive
If the sperm gamete that fertilizes an egg has a(n) _____ chromosome, it will form male offspring. X Y XY XX
why do you subtract exponents when dividing powers with the same base?
Wearing this colour after Labour Day might get you a ticket from a fashion cop! A. Pale Pink B. White C. Lime Green D. Gray
______-the sum of the kinetic and potential;energy of all the atoms in an object