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

Two planes are driving toward each other with the speeds 250 mph and 420 mph respectively. If the distance between them are 1250 miles, in how many hours they w
If x = (34•68)+245 what is 50% of x?
Which kingdom includes only multi cellular heterotrophs whose cells lack a cell wall
Which system of equations correspond to this matrix equation? Question 9 options: 5x + 2x = -7 3y - 4y = -6 5x + 2y = -7 3x + 4y = -6 5x + 2y = -7 3x - 4y
Which of the following is the best definition of a scientific theory?Help me plz
what is biosphere reserve?
Three friends decide to evenly split their bill at a restaurant. The total bill is $84.99 and they will have to pay an additional $5.10 tax. One of the friends
Which kingdom includes only multi cellular heterotrophs whose cells lack a cell wall
10×9×8×7×6×5×4×3×2×1=10 Is it possible? Why or why not?
HELP ME How has the discovery and usage of the periodic table benefited society? Select all that apply It has enabled scientists to communicate chemical discov