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

How do you think European rulers were able to get African leaders to sign the petition?
Why is pulmonary circulation reduced in the unborn fetus.
Anne is checking out of a hotel. The price before the tip is $48, and Anne wants to tip 6%. What is the total price Anne will pay for the hotel stay?
Pls help !!!!!!!!!!!!!
What specific cryptocurrency was worth $68,000 in november but had fallen to less than $36,000 by the beginning of this week?.
Please help due today
In addition to paintings, prints, and combination pieces, what artist has done extensive set and costume design for Merce Cunningham, as well as graphic design
Please help meeeee!!!!!
What fast food chain used reindeer to deliver food in japan?.
Your new manager is highly motivational, gives clear directions and timelines, and is quick to point out inefficiencies. They likely ascribe to ______ leadershi