33.3k views
1 vote
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​

1 Answer

1 vote

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()

Step-by-step explanation:

User Prody
by
4.2k points