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

Which of the following would be used to warn residents about a tsunami in the aftermath of a magnitude 8.8 earthquake? DART PTWC WCATWC IOTWC
Which process occurs in the first few weeks after conception?
which elements are likelyto gain electrons?
Use the angle relationship in the figure below to solve for x. Assume that line A and line Bare parallel, line C is a transversal and the given angles are given
Can someone help me with this please!! 20 points !!! if you do
Solve for x. 5x – 4 > 12 AND 12x + 5-4
If you wanted to make sure a company has enough money available to pay its bills, which financial statement would be most helpful? A. Balance sheet B. Income st
Daniel found 3 small whiteboards and 6 boxes of markers for coaches to use . Mr.Adams said they need a total of 8 white boards and 10 boxes of narkers How ma
Sol - Mi Guess the song There are 2 BEATS in every measure. You start on SOL.
is dragon ball z cooler than Naruto