Selecting the Larger value formula between two values in Python

Swap.py - This program determines the minimum and maximum of three values input by the user and performs necessary swaps.
Input: Three int values.
Output: The numbers in numerical order. first = 101 second = 22 third = -23

Get user input first = int(input("Enter first number: ")) second = int(input("Enter second number: ")) third = int(input("Enter third number: "))

Test to see if the first number is greater than the second number max(101,22)

Test to see if the second number is greater than the third number max(22,-23)

Test to see if the first number is greater than the second number again max(101,22)

Print numbers in numerical order print("Smallest: " + str(first)) print("Next smallest: " + str(second)) print("Largest: " + str(third))

/r/learnpython Thread Parent