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's Saul's father name?
What is the physical properties of chlorine
14=-3y i need help solving this
Wisdom to the wise man is an uncommon degree of common sense. Do you agree? (Not an assignment, I simply just want your opinion)
American Revolution battles that occurred in Charleston and Camden, South Carolina, were a. minor victories for the Continental army. b. minor defeats for the C
If a cell has the ability to take in water, food molecules, and other necessary materials this indicates it is capable of Biosynthesis Nutrition Absorption Dige
what is a calorie also referred too?
If the legs of a right triangle have lengths of 6 inches and 8 inches, what is the length of the hypotenuse in inches?
How are mass and weight different? mass is the space an object takes up and weight is the effect of gravity on mass. mass is the amount of matter and weight is
Why cells need to be split?