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

Please answer both questions separately(no fake answer). (2-5 sentences) 1. How did the South respond to Nat Turner’s rebellion?
what make it animal or plant cell?​
PLEASE HELP I SUCK AT MATH Rodney's Roller Rink uses the equation y =10x+75 to determine the cost for a birthday party with x children. The table below shows th
What is the value of x?
pls help me i only got 5 minutes left
Two angles are supplementary the first angle is 93 what is the measure of the second angle
A ____ is a transformation that uses a ratio known as ____factor to enlarge or____ a figure on the coordinate plane that without changing the ____ of the figur
Two identical soccer balls are rolled toward each other. What will be true after they collide headon? (2 points)
People living in the cold regions of Russia and Finland often build their structures with To prevent them collapsing from the weight of snow. A slanted roofs B
Where is point K(-100, 100)located?​