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 are five ways of identifying a rational number ?
Explain the characteristics of renaissance thought literature and art
Which of the following are ways that AIDS cannot be transmitted? sexual activity with someone who has it dirty (shared) needles used by drug addicts poorly te
What type of molecule is a chemical compound that contains carbon bonded to at least one other atom, usually hydrogen and is found in all living things? A. Pola
Name two ways in which ceramic artists create vessels/pots?
In this lesson, we identified many uses of geography. One example is urban planning. How would geography be useful in helping to plan the future of a community?
You should have been careful with those fragile dishes.What is the verb?
I WILL GIVE BRAINLIEST) What kind of government does Taiwan have?
What promises that I don’t Hitler make to the German people Aiden his rise to power as the leader of the third rage
4x + 20 = 100 show the work please