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 city was located nearest the nile river delta
which city was located nearest the nile river delta
Which two numbers have a difference of 5 and a product of 3.36???
which city was located nearest the nile river delta
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
write words to match the expression. 24- ( 6+3)
write words to match the expression. 24- ( 6+3)
If you are writing a persuasive essay in favor of banning vending machines in schools, which is a counterargument you might anticipate?
Which two numbers have a difference of 5 and a product of 3.36???
which city was located nearest the nile river delta