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

How can air pollution be reduced? Burn more fossil fuels. Walk fewer places. Place more cars on the road. Plant more trees.
what is your question in climate change?​
Whom or what does Montag most likely believe is at the door while they are reading the books? A. Clarisse McClellan B. Captain Beatty C. Faber D. The Hound
Click the links to open the resources below. These resources will help you complete the assignment. Once you have created your file(s) and are ready to upload y
Two angles are complementary. One angle measures (x+15) degrees and the other angle measures 40 degrees solve for x​
what caused the nationalists kuomintang and the communists to pause the chinese civil war
What is the molecular mass
I NEED HELPP WITH MATH HOMEWORK PLSSS
the ____ phase in the business cycle is a period that marks the end of declining business activity.
1 A steel ball of mass 5 kg is released from rest at a height of 3 m above the ground. It rolls down the frictionless section AB and then moves up the rough inc