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 greatest composite odd numbers less than 40
Why did the ancient Chinese organize large groups of people to build and maintain irrigation systems? based on an order from the emperor to accommodate for lack
Which of the following was not a contributing factor in the Spanish defeat of the Aztec and Inca? a. The Spanish formed military alliances with enemies of the A
Under feudalism, which group was responsible for ruling different regions of a country? peasants knights lords king
Generally, since the beginning of the twentieth century, the word imitation is usually associated with _______ rather than superior art
elli has some money If she buys 2 comic books, she will have $7 left If she buys 3 comic books, she will need $8 more. How much does each book cost?
Which was the final battle in the American Revolution? A. Yorktown B. Bunker Hill C. Saratoga D. Lexington
find the remainder when f(x)=x^3-14x^2+51x-22 is divided by x-7
what's a good thesis statement for a research paper about cancer?
.7n-1.5+7.3n=14.5 what is the answer to this quetion