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

Use the factor theorem to determine whether the binomial x + 1 is a factor of the polynomial function ?(x) = 2x3 – 9x2 + 17x – 6.
determina el producto (x-y+1) ( x-y-1)
Carlos saved 12 dollars last week and 24 this week time as much as he saved last week
A potter takes 5 hours to make 8 vases. If he continues to work at the same rate, find how long it would take him to make 16 vases?
What elemental trend exists in each row as we move from left to right on the periodic table? Number of protons decreases Number of protons increases Chemical
what is the gcf of 36 and 63?
If the gravitational force between the electron (9.11 ✕ 10-31 kg) and the proton (1.67 ✕ 10-27 kg) in a hydrogen atom is 1.26 ✕ 10-47 n, how far apart are the t
Identify and explain one reason for the success of islam during the post-classical period
Read these lines that contain a flashback. "I know how it will be," his sister had said when he was preparing to migrate to this rural retreat; "you will bury
math help @Alessandroarenas