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

Simplify the answer. 10y=3y+63
Type the correct answer in the box. [tex]log\frac{14}{3}+log\frac{11}{5}-log\frac{22}{15} = log[/tex] (correct answer goes here)
tehre are 5 different math books, 3 different science books and 2 different english books. how many way can u arrange them?
Questions 1-8: Complete each statement about parallelogram
Mother needs 7.5 metres of cloth to sew 5 bags. How many metres of cloth must she buy to sew 12 such bags?
What is human trafficking? ​
Which combination of light wavelengths (colors) and light intensity resulted in the quickest flowers? Red, white, far red led light. 8. In the Notebook Short-da
HELP!!!! 50 POINTS What is the genotype of individual |||-2?​
Whats the answer i never understand Philippines language in history. Pls help Just answer 5-10 please...
World map Match the number on the map with the name of the Continent or Ocean. Question 9 options: Pacific Ocean South America Asia Atlantic Ocean Ind