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

Read the following excerpt from Life on the Mississippi by Mark Twain: The town drunkard stirs, the clerks wake up, a furious clatter of drays follows, every h
At 10:05 a.m., there are 2 microscopic bacteria cells in a bottle .at 10:15a.m., there are 8 cells one the bottle. What time will there be 16 cells in a bottle
Sculptors will often create a “sketch” out of ________ to test ideas before proceeding to their medium of choice.
this is not the correct answer.
Which condition results in a reduced sense of touch?
How do you convert 4 9/10 as a decimal?
?A(n) __________ is violent crowd behavior that is fueled by deep-seated emotions but not directed at one specific target.
Brian has 2000 small building blocks he decides to share them with his cousin Tia he gives tier 1/4 of the blocks how many blocks did he keep
What effect does an unbalanced force have on an object?
Circle S, what is the value of X