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

You would use quotation marks to punctuate the title of a
What problem is caused by maps being two dimensional?
What contributed to the fall of the Mughal Empire?
Jeremy opens a chocolate shop in the city. He pays $1,500 a month for rent and maintenance of the shop. The price of raw materials and manufacturing the chocola
find the perimeter of a trapezoid with sides that measure 16.1 inches, 6.32 inches, 8.0 inches, and 13 inches.
convert 7 centimeters to milimeters
which french explorer sailed down the mississippi river to its basin? verrazano
A null hypothesis is being tested. How does the confidence level affect the testing process?
how equality between the sexes shaped human society
What's the missing factor 4,6,9,14,?,49