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

HELP ME PLZZZZ ASAP...................
Carson Lee, a staff accountant, is a working on some research for his partner, Joe Davis. Joe has asked Carson to find the proper citation providing guidance on
Taxi Express charges $2.60 plus $3.65 per mile, and Cab Cruiser charges $2.75 plus $3.90 per mile. Which expression represents how much more (in dollars) Cab Cr
what happens during jury deliberation in a criminal court case?​
classify the following as mixture. *
explain why photosynthesis and cellular respiration are dependent on each other
Lines p and q are parallel. 60° What is the measure of angle 2 in degrees? 27 degrees 33 degrees 60 degrees 93 degrees HELP ASAP PLEASE !
On January 1, 2019, Pyle Company purchased an asset that cost $52,400 and had no estimated residual value. The estimated useful life of the asset is 8 years and
If a three-toed sloth mood 0.15 miles per hour for 7 hours how far did it go?
I need the answer to the question