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

A pipe that's 36 inches long needs to be cut into 2 and one forth inches long pieces. how may pieces can be cut from this length of pipe
In winter many dogs grow a thick coat of fur. This is an example of
while playing a game maria defeated 8 enemies with each enemy defeated earing her 7594 points if she traded in all her points for 2 extra lives how many points
What is four times two?
What is the evolutionary basis for organisms in the class Mammalia?
Which of the following events happens first in Edgar Allan Poe's "The Black Cat"? A. The narrator comes home drunk and cuts out one of the eyes of his cat.
How to do this problem I have
determine the number of real solutions -4x^2+20x-25=0'
An office supply Store A is offering copy paper for $3.00 per pack. Store B is running a special of buy two for $4.20 each and get one free. You need 12 packs o
what was the main reason joseph stalin created collective farms?