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

If you have read hamlet. Help me plz.
Number 7 and 8 please (:
If the circumference of the circular base of a cylinder is doubled, how does the volume of the cylinder change? A) The volume doubled. B) The volume tripled.
A biologist counted 10,000 migrating monarch butterflies. How do you express 10,000 as a power of 10?
will walks his dog around the block they spent an hour walking and make it 4 km what is there speed
An object has a mass of 50.0 g and a volume of 10.5 cm3. What is the object's density?
Find two consecutive even integers X and X +2 with the product of 70
what is the significance of each one of these holidays to the South Africans?
During the Korean War, General MacArthur carried out an invasion behind enemy lines at __________________.
Your adjusted gross income is your gross income minus specific deductions. true or false?