thor12395
thor12395 thor12395
  • 23-07-2021
  • Computers and Technology
contestada


Write program to input 4 numbers and print the maximum and minimum using math function (don't use if else).
please I need it.....
fast​

Respuesta :

RemielUri
RemielUri RemielUri
  • 23-07-2021

Answer:

def main():

   num1 = int(input("Type in a number: "))

   num2 = int(input("Type in a number: "))

   num3 = int(input("Type in a number: "))

   num4 = int(input("Type in a number: "))

   list1 = [num1, num2, num3, num4]

   list1.sort()

   print(f"The largest number is: {list1[-1]} The smallest number is: {list1[-len(list1)]}")

main()

Explanation:

Answer Link

Otras preguntas

What is 40 plus 1 please
0.15=0.150 true or false
why were advances in transportation and communication important to the second industrial revolution
Does 'Balance of Power' prevent war or promote war?What is your opinion?
one effect of uncontrolled diabetes is that the blood might develop an acidic ph. As a result, cells may not be able to regulate their internal pH. Within these
senators are elected six years and may be re-elected as often as the people wish to vote for them. true or false?
8. The largest of the five so-called "civilized tribes" was the A. Seminole. B. Creek. C. Choctaw. D. Cherokee
Multi-step: A perfect score on a test with 25 questions is 100. Each question is worth the same number of points. a. How many points is each question on the tes
one effect of uncontrolled diabetes is that the blood might develop an acidic ph. As a result, cells may not be able to regulate their internal pH. Within these
the sum of 7 twelves and 13 twelves