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

What types of radiation make up background radiation
What’s percent of 50 is 8?
What are three other ways you can reinforce your message when you’re saying no?
Which president of the United States passed the rights of the Panama Canal to the government of panama
Did the development of machines led to the beginning of the factory system.
The perimeter of a rectangle is 240 m If its length is decreased by 10% and breadth is increased by 20% , we get the same perimeter, Find the length and the bre
bills video files take up 15 gigs of space on his hard drive about how many bytes is that
How old was julius caesar when he became emperor?
The joining of two organs that are narmally separate is called:
in the number 14,400 what does the digit in the hundreds place represent compared to the thousands place