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

Describe the Following Terms and Concepts
Choose a correct sentence: a) If I had time, I would written this book that I wanted b) If you warm water, it will boil c) I would have bought a house if I
Which statement is correct? A. The opposite of the opposite of 2 is 2. B. The opposite of the opposite of 3 is . C. The opposite of the opposite of 1 is −
How does the limited sports equipment affect the training of the student athletes?
Where else would elastin be helpful in keeping bones safe from absorbing too much energy
Get ready for a tough one! All the digits are different odd numbers between 0 and 10. The number with the greatest value is in the thousands place. The number w
How long does a bacteria run and tumble?
A lot has a frontage of 100ft and a depth of 150ft. If the building line regulations call for a setback of 25ft at the front, 10ft at the back, and 6ft on each
Can I have sex?????????????????????
A chronic infection of what is likely to kill a person with cystic fibrosis?