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

hello what you doing
Michelle works in retail and can't decide what product to include in the store's front window display. what is the first step she should take to solve this prob
There are two forces on the 1.11 kg box in the overhead view of the figure but only one is shown. For F1 = 11.1 N, a = 14.0 m/s2, and θ = 31.7°, find the second
solve the equation -3(x - 1) + 7x = 27
Can someone please summarize this, Please? 30pts + Brainliest! The world’s population could swell to 10.9 billion by the end of the century, a new United Nation
Despite the Armenian Quarter being part of a major religion… why did it get its own separate section of the Old City? simply answer please
Find the perimeter of the polygon.
what is the angle of x if one angle is 54
“...the city was like a movie playing before her eyes.” What figurative device is used in this guote. If you can answer any plz do !!!!!!!!
Alexandria, the center of Hellenistic culture, became part of what kingdom? A Pergamum B Seleucid C Egyptian D Macedonian