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 the equivalent to 7.4 kilograms
In the Southern subregion of sub-Saharan Africa, which country is mainly covered by the Kalahari Desert?
the ratio of isabellas money to shanes money is 3:11. If isabella has $33, how much money do Shane and Isabella have together?
Founded by Oliver H. Kelley, the organization that came to be known as the _______ provided educational, social, and cultural activities to its rural members. A
Why were scenes from celebrations and contests painted on palace walls? a. so visitors could understand the social customs of the wealthy b. To praise the royal
How did the issue of slavery divide the union
Sue scored a total of 35 points in two games she scored 6 times as many points in the second game as in the first how many more points did she score in the seco
how does arachne feel about her weaving skill
round 44,769 to the nearest ten
The instantaneous velocity of an object is the blank of the object with a blank