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

Long-term goals cannot be accomplished immediately.
Which one of the following choices best represents a source of polyunsaturated fats? a. Fish b. Avocados c. Almonds d. Olive oil
Which of the following vertebrates are ectothermic? a.hummingbirds b.newts c.kangaroos d.horses
Desalination is an inexpensive way to produce fresh water. a. True b. False
What is grater 3/4 or 3/8
Major events of young adulthood can include all of the following EXCEPT: a. starting a family b. selecting a job or career path c. entering into a committed rel
Brain development leads an infant to undergo ____________, which occurs as unused neural connections weaken and disappear. Please select the best answer from th
The United States has this type of economic system. User: An economic system in which the government makes all decisions about how goods and services are produc
The Delian League provided city-states with security, but lessened independence. a. True b. False
what is the shortset 1/3 2/5 3/10 or 1/4