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

Which word in the sentence does the adjective modify? The people listened closely to the lively speech.
Advanced European weaponry meant that A. a few hundred Europeans could overrun massive native empires. B. native populations were able to use guerilla warfare t
Wind with Miller has some unusually spelled words. Where does this website originate?
What part or parts of the word Egyptologist tell you that an Egyptologist is a scientist?
Quelleest la prifession de Mărie claude
Mandate of Heaven , production of silk, and reverence of ancestors are all characteristics associated with civilizations in
There are 36 carpenters in a crew. On a certain day, 29 were present. What percent showed up for work? (round to the nearest tenth)
Through which process is energy transferred to a molecule that the cell can use as fuel for its various activities?
41.Which statement best describes the relationship that exist among proteins, DNA, and cells A. Proteins combined to produce cells,which ProducesProduce DNA B.
What is 0.1 as a fraction in simplest form?