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

Why is saturn's atmosphere almost three times thicker than jupiter's?
Is china or japan more important to american trade today?
What is the scientific notation of 19
Please Help...... Graph f(x)=2x+1 and g(x)=−x+4 on the same coordinate plane. What is the solution to the equation f(x)=g(x) ?
In common sense who does Paine say will be affected by what happens in the Mercian colonies
pls help Use the perpendicular bisector theorem to solve for x
What was montag afraid would happen when the captain came to visit?
Assess the causes and consequences of social inequality in Manchester. (9 marks)
write a verbal expression for 100-5n
what are the consequences of smoking while pregnant 1. Sids 2. Stillbirth. 3.miscarriage 4. Birth defects 5. Large birth weight