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

Cracking the periodic table code why aren't the elements listed in alphabetical order answer key
Notice the areas where land existed in 18000 bc. what effects might the existence of more land by 18000 bc. have had on hominids
Write the sum eπ/4 + eπ/5 + eπ/6 + ... + eπ/n in summation notation in terms of k.
the speakers use of pauses in her speech reflect that she is all of the following except
How many fontanelles does a newborn​ have, and when do they​ close? chap 8?
The air in an inflated balloon (the system) absorbs 125 J of heat from its proximity to a fire. The balloon expands and does 85 kJ of work. What is the change i
Identify the adjectives, My new puppy has curly, black fur, and enormous paws
How does free health care reduce poverty?
If a hydrogen atom gains an electron, then
In the movie Thor, thor must prove that he is worthy of being a king before he can use his mighty hammer.Which word describes the conflict best?