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

if the score is 90% and the total is 70 what is the number correct ?
An astronaut who weighs 126lb on Earth weighs only21lb on the moon. How much would a person who weights 31lb on the moon weigh on Earth?
which number is 100 less than 61 tens?
Because the majority of the evening cable TV programs available dealt with violence and sex, the parents decided that the programs were for the children to watc
Add the following fractions.3/8 + 5/12 =
The data represent the ages of people working at a store. 19, 27, 20, 26, 20, 24, 32, 23, 20, 19, 21 What is the first quartile of these ages?
three snack bars contain 1/5,0.22,and 19% of their calories from fat. which snack bar contains the least amount of calories from fat ?
how do you solve 2.75+.003+.158=
How did allies hide from Germans D-day invasion plan?
Convert 79 oz to _____ g Round answer to the nearest whole gram.