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

Which of the following is a correct comparison of the Hawaiian Islands and the Mississippi Delta? The Hawaiian Islands were formed by constructive forces, but t
Helps hurry I’ll make you brainlist
what happen after pennsylvania and connecticut voted to ratify the constitution, but before all 13 states vote in your favor of ratifying the constitution?
Help please thank you!
Which expression is equivalent to (2g^3+4)^2
The total cost is $43.25 . He had to pay $7 fee along with the 1.25 per minute on swing
What medium did guglielmo marconi help invent?
Which of these energy resources is the easiest to get to power stations and the most users?
Which of the following is represented by ST?​D.circumferencec radiusB centerA Diameter
ax+by=c so, what does x equal