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

Where is the moon? I’m graduated so my points are up for grabs cause I’ll never use them. I have to at least as a question with it though.
the length of a rectangular is one less than twice the width. Find the length + width, if the perimeter is 40
Which of these statements is true: 1) It is not uncommon for most of the people in the top 5 percent of income-earners to be 45 years old and up. 2) Three-quar
How are you feeling today
what is 6,389 divided by 27
any g,,,irl can be my bestie forever​
What is a tree? I’m graduated so my points are up for grabs cause I’ll never use them. I have to at least as a question with it though.
Solve the equation, 2x + 1 = 3, for x. Which of the following properties of equality did you apply? Question 5 options: A) Subtraction and division B) Subtracti
Determine which set of side measurements could be used to form a right triangle. 3, 11, 20 5, 9, 17 6, 7, 8 6, 8, 10
It costs $2.50 to rent bowling shoes. Each game costs $2.25. You have $9.25. Write and solve an equation to find out how many games you can bowl.