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 of the following is the electron configuration of an electrically neutral atom of argon (Ar)? (a) 1s² 2s² 2p5 (b) 1s² 3d¹⁰ 4f⁷ (c) 1s² 2s² 2p⁶ 3s² 3s⁶ (d)
what type of government exists when there are several leaders
if a police is driving a car at 90 miles per hour and an old woman was driving at 60 miles per hour, if the old woman got a head start to the chase, how many ho
I need help with 6-11
How many types of rocks are there
the skunk sprayed people 70% of the people he saw on his walk. if he saw a total of 30 people,how many people did he spray?
Which of the following was best compares an armistice to a peace treaty
Which of these elements exists as a solid at room temp and pressure? Chlorine, bromine and iodine. Why?
11 more than 11 less than (11x6)
What is the product of 3.4 x[tex] {10}^{3} [/tex]