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

Q=p(r+s) Solve for p.
Which sentence is correctly hyphenated? Which sentence is correctly hyphenated? She decided to take the long-winding road. A tall-dark man approached the entra
what was the purpose of the articles of confederation?
A large container holds 8 gallons of water. It begins leaking at a constant rate. After 16 minutes, the container has 7 gallons of water left.
Please answer the following question in Spanish: How would you greet your teacher in the morning? When entering your answers for fill in the blank and essay que
Find three pairs of numbers for which the least common multiple equals the product of the two numbers
What did england import from the colonies to make furniture
What does temperature determine of most matter
what is 13,952 rounded to
Sargon conquered Ur and Nippur. a. Yes b. No