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 is 25% of $500.00? I think the answer is $475.00 Can someone verify if twenty five percent of 500.00 is $475.00
Forget the motor When im on the boat Think of the best time To buy a new coat What am I......?
Thelma spent 1/6 of her weekly allowance on dog toys.  1/4 on a dog collar and 1/3 on dog food.  What fraction of her weekly allowance is left
The ______ was established in 1943 to assist in the transition from a peacetime to a wartime economy ?
The ______ was established in 1943 to assist in the transition from a peacetime to a wartime economy ?
Forget the motor When im on the boat Think of the best time To buy a new coat What am I......?
Factor the expression. If the expression cannot be factored, say so.
find the sum. write each mixed number in simplest form 4 7/8 + 5 1/4
What were the contributions of the Harappan civilization?
josh wanted to buy a bicycle but didn't have enough money. After josh told his troubles to sam slick, sam said,"I can fix that. see that fence? each time you ju