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 i bike travels 15m in 2 sec, what is its speen in km/h?
You, as a language arts teacher, are teaching your students an area of study that involves mechanics, usage, and sentence formation. What area of study are thes
HELP ME PLEASE SOON BEFORE 1/4/2021 When Simba is staring up into the stars at the image of his father, Mufusa says “When Simba is staring Mufusa says “You are
3. a stone thrown up is caught by the thrower after 6 seconds how high did it go and where was it 4 seconds after start (g = 9.8m/s2)??​
One of the most important features of a filing and record keeping system is that it works for you and meets your needs.A. TrueB. False
please urgent please help
Please solve! It's really easy (I think).
Find the sum of the geometric series. /3-3/2+3|3/4-9/8+...
There is no such thing as too many clients. O True O False
Napoleon invaded Russia with an army of 600,000 men. How many French soldiers survived? A) 300,000 B) 150,000 C) 50,000 D) 10,000​