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 many “dots” would be around the central atom in the Lewis structure of S? A) 5 B) 6 C) 7 D) 4
Approximately how many miles apart are Petrograd and Moscow ? A. 200 B. 350 C. 500 D. 650
How do I make a formula for a line if they only give me the intercept and the slope
Dirk Nowitzki of the Dallas mavericks scored 44 points in a recent basketball game. He scored no 3-point shots, but made a number of 2-point field goals and 1-p
what is 54 times 3 times 71 minus 45 plus 102 divided by 6 times 25 subtracted by 34 times 141 plus 32 subtracted by 67? Also put 578402/10856 in simplest form.
find the value of x to the nearest whole number. Tan x(degree) = 1.732
You are given an aqueous solution of NaCl. The simplest method for the separation of NaCl from the solution is (A) evaporation of the solution to dryness (B) c
Add and simplify 9/16 + 1/2= ?
what is the percent notation for 6.4%
The volume of a rectangular prism is 270 cubic centimeters. The height of the prism is 5 centimeters. What should the length and width of the prism be? Explain