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

Which is the graph of f(x) = |x| +3? ​
Johan has 15 bags of potato chips. All his 6 friends want 3/5 of a bad of chips, so he pours the chips into bowls. He takes a whole bag. How many full bags are
What is a midwife?????
ssssssssssssssssssssssssssss
Mr. Smith had 3/4 of a peach pie left over. He spilt the leftover pie among his 3 co-workers. What fraction of the pie did each co-worker receive​
What was the relationship between the prejudice against the jewish
A car goes at a speed of 100 k / h. Suddenly, at a distance of 50 m, the driver notices an obstacle. Is it possible to avoid collision if you decelerate at 4.9m
Help pls:( I’ll give you a crown if it’s right
help me pls ill mark brainly
What characterized the New Kingdom in Ancient Egypt