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

Rand has 10 points. Randy has 8 points. how many more does Rand have than Randy?
Help math questions.20 points solve for xPlease show work if possible.
If it takes 26 hours for Jane to paint a house, and it takes 22 hours for Julie to paint the house, how long will it take them working together? (Round your ans
Write a balanced equation for the combination of magnesium and oxygen to form magnesium oxide, mgo. phase symbols are not graded.
To replace burned skin doctor can successfully transplants replacement skin taken from another part of body of the burn victim.which statement best explains why
PLEASE HELP I NEED HELP
CANN SOMEONE HELP ME PLEASEEE? I just need the example
You are buying 30 acres of farm land at $12,000 per acre. What is the total cost?
Are the two triangles below similar? (5 points) Triangles GHI and JKL are shown. Angle H measures 95 degrees, angle I measures 50 degrees, side GH measures 9,
Graph the image of this figure after a dilation with a scale factor of 2 centered at (−3, 1) . Use the polygon tool to graph the dilated figure.