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

Please help with two column proof
Why have most Indians settled in the coastal regions and the Indo-Gangetic Plain?
In 1850, how many of the ten most populous cities were located in states that were part of the original thirteen colonies?
why were the streets of Cretans wide
Which song style was developed by berry gordy jr. in detroit?
We cannot see evaporation because water vapor is invisible. How can we tell it is happening?
Who sets the salary of the president?        A. Senate   B. Congress   C. Vice President   D. Citizens
Consider the relationship between the place values of the 4s in this number. 444.44 . Choose all answers that are correct. A. The 4 in the hundredths place is 1
what event brought about the adoption of the 25th amendment?
someone please help....