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

The ratio of boys to girls in the 9th grade is 5 to 6. There are 312 girls. How many boys are there?
what is 7 times the square root of 96m^3
At 10 A.M., the temperature was 71F°. At 3 P.M., the temperature was 86F°. Find the value of the slope and explain what it means.
Some irrational numbers are integers. True or false? Explain your choice.
Which is a sentence fragment? A. This morning the sunrise was spectacular. B. We bought milk, bread, and eggs. C. A pencil, four sheets of paper, and a rule
How violence used by the characters to deal with their emotions? (the outsiders)?
What passages illustrate Paine's effort to write in language ordinary readers can understand in the book of Voices of Freedom by Thomas Paine
What message might these frequent and violent changes in leadership have sent to people living outside the Roman Empire?
How did building New England towns and cities around a common help colonies develop a diverse economy?
6,435,920,178 in expanded form