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

Do intercostal muscles contract or relax when we breathe.
Las películas no __________ temprano.
HELP ASAP I WILL GIVE 50 POINTS
In terms of diameter, the planet Saturn is larger than _______ , but smaller than _______. A. Venus; Jupiter B. Uranus; Mars C. Mercury; Venus D. Jupite
Help please I need help with this (And don't just put random stuff to steal my points)
Is the reproduction of sea urchins sexual or asexual?.
What does it mean to the nearest tenth of a degree.
. A company makes and boxes spaghetti. One machine fills each box with approximately 32 ounces of spaghetti. After the boxes are filled, another machine weighs
Part A Based on "Golden Days," how do some people feel during winter? O People enjoy relief from summer's heat. O They are depressed. O They are hopeful. O Peop
Chris bought 2.5 pounds of pears for $1.00 per pound. He also bought 1.3 pounds of apples for $3.00 per pound. Tim gave the cashier $20 for the pears and apples