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

can anybody please help me fill in these blanks?? thank you so much if u can!
Prove the divisibility of the following numbers:25^9 + 5^7 is divisible by 30.Also, read as (25 to the power of 9) + (5 to the power of 7) is divisible by 30.An
A line passes through 3,7 and 6,9 what equation represents the line
How much orange juice do you need to make 2 servings of lemony orange slush?
In an economic downturn, what can happen in countries that depend on high taxes to fund social programs?
Why didn’t the United States participate in the League of Nations? The U.S. Senate did not want the country to join. President Wilson did not want the country t
Please need help with this
The radius of the earth is two times the radius of the moon. What fraction of the volume of the earth is the volume of the moon?
According to the 2008 U.S. census, California had a population of approximately 4 × 10^7 people and Florida had a population of approximately 2 × 10^7 people.
What verb tense should I use when talking about the past?