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

A player ran 30 yards in a football game. How many feet did the player run?
explain your answer with given reason warning:(if you get reported more then 5 times. then you will lose your account
If a student tries to appear more attentive than he or she actually is when a teacher happens to be watching. Erving Goffman would more than likely call this:
Hey is any one able to help me
look at screenshot and please answer
Which government commission monitors the hiring practices of organizations by analyzing their annual hiring reports
Find the sum of − 8 x 2 + 3 −8x 2 +3 and − 9 x 2 + 3 x − 3 −9x 2 +3x−3
50 points helpppppppppppppppp
In preparing for a speech next week, you discover that one member of the audience has a vision impairment. To find out how to meet her needs, whom should you co
Have you ever assumed that a class would be easier than it actually was? Explain.