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

Someone help me PLEASE ! What is the measure of the indicated central angle? A) 10 degrees B) 20 degrees C) 30 degrees D) 40 degrees E) None of the above
Which feminist delivered her “Ain’t I a Woman “ speech in 1851
the measures of the three angles of a triangle are given by 3x + 1 2x - 3 + 9x what is the measure of the smallest angle​
If the population of rabbits in this ecosystem decreased dramatically because of certain environmental changes, which organisms’ food supply would decrease?A. o
What is the value of y in the following system? 5x + y = 9 10x - 7y = -18
It took Sharon 85 minutes to wash three cars. She spent x minutes on each car and 10 minutes putting everything away. How long did it take Sharon to wash each c
15 points please help
HELP!!! CORRECT ANSWER NEEDED OR ELSE I FAIL ;-; STUDY ISLAND !!Step 2:4 + 1/6 + 3 + 5/6Step 3:4 + 3 + 1/6 + 5/6In the addition problem above, which properties
Can someone help me on this question please and explain how you got the answers
What is a prognosis?