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

Three students share 5 peaches equally. How many peaches does each student get?
What is one difference between a primary oocyte and a secondary oocyte in humans?
what properties do scientists use to identify minerals
what is 7/21 in its simplest form
What does smooth ER lack that rough ER has?
Three students share 5 peaches equally. How many peaches does each student get?
factious : argumentative :: A. rhapsodic : critical B. efficacious : harmful C. beneficent : kindly D. facile : clumsy
the oscillations producing a light wave are
What does it mean to call someone a “Benedict Arnold”?
Caitlin has 4 3/4 pounds of clay . She uses 1 1/10 pounds to make a cup ,and another 2 pounds to make a jar , how many pounds are left write an equation