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

The town swimming pool is d feet deep. The width of the pool is 10 feet greater than 5 times the depth. The length of the pool is 25 feet greater than the width
HELP I REALLY NEED HELP ON THIS !
write 63 as product of prime factors
OF THE SHAPES SHOWN 1/6 are triangles and 5/12 are pentagons. What fraction of the shapes are either triangles or pentagons. there are 5 pentagons, 2 triangles,
which of the following countries is in central america A. Cuba B.guatemala C.puerto Rico D.haiti
According to Postman, what technology is a forerunner of television?  A.Radiography  B.Newspaper  C.Telegraphy  D.Books
Besides enslaved Africans what was brought from the west Indies to the colonies
Which of the following is an example of mechanical weathering? A.gravity B.oxidation C.acid formation D.lava intrusion
What is a project portfolio?
Mrs. Watson suggested that Sam revise his science paper and change from the passive to the active voice. Which would be the correct way to rewrite this sentence