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

Why did the US Supreme Court rule against the state of Tennessee in Baker v. Carr?
What causes toxic shock syndrome?
Define democracy.write any three common features of democratic countries
Cesar Chavez helped turn a labor strike into a campaign for: A. Fighting monopolies. B. Industrial workers. C. Civil rights. D. Immigration laws.
Describe how the church attempted to battle the ideas of the scientific revolution and the enlightenment
What is the volume of a prism with the length (x+9) width (x+5) and (x+4)? Please Help
In what ways are human genetics similar to fruit fly or pea plant genetics
Christina wanted to know more about the effects of earthquakes, so she created a model and performed an experiment. In Christina's model, she carefully layered
The sum of consecutive odd numbers is 69 what is the third number in this sequence?
Which setting would allow you to observe a specimen with the highest possible magnification? A) Objective 5x Ocular 5x B) Objective 5x Ocular 10x C) Objective